Skip to contentSkip to conversation

Disable cache disk

DISCUSSION Yves Crespin 3 participants 5 messages Mar 30, 2005 – Mar 31, 2005

lore
Share & tools
lore
#0 lore raw

Hello,

I write a lot of files on a USB disk for video monitoring archiving.
The write program is faster than the USB.
Cache disk take all RAM and kernel start swapping and everything become very slow.
1/ is-it possible to *really* be synchronize. I prefer to have a blocked write() than use cache and get swap! 2/ is-it possible to disable cache disk ?

Thanks,

Yves

begin:vcard
fn:Yves Crespin
n:Crespin;Yves
org:Quartz
adr:Hameau du Pra - CIDEX 322;;39, rue Victor Hugo;CROLLES;;38920;France email;internet:[email protected] tel;work:04.76.92.21.91
tel;cell:06.86.42.86.81
x-mozilla-html:FALSE
url:http://crespin.quartz.free.fr/
version:2.1
end:vcard

#1 lore raw
Quoted 7 lines · Yves Crespin

Hello,

I write a lot of files on a USB disk for video monitoring archiving.
The write program is faster than the USB.
Cache disk take all RAM and kernel start swapping and everything become very slow.
1/ is-it possible to *really* be synchronize. I prefer to have a blocked write() than use cache and get swap! 2/ is-it possible to disable cache disk ?

Try open() with O_DIRECT flag for a start.

/mjt

#2 lore raw
In reply to Yves Crespin
Quoted 2 lines · Yves Crespin

1/ is-it possible to *really* be synchronize. I prefer to have a blocked write() than use cache and get swap!

Try to mount with the sync option.

Quoted 1 line

2/ is-it possible to disable cache disk ?

your copy tool has to support/use O_DIRECT

#3 lore raw
Quoted 11 lines · Christian Bornträger
Quoted 4 lines · Yves Crespin

1/ is-it possible to *really* be synchronize. I prefer to have a blocked write() than use cache and get swap!

Try to mount with the sync option.

exactly async and noatime ?

Quoted 9 lines
Quoted 5 lines

2/ is-it possible to disable cache disk ?

your copy tool has to support/use O_DIRECT

is O_DIRECT a POSIX option ?
http://www.opengroup.org/onlinepubs/007908799/xsh/open.html
Is O_SYNC also necessary ?

#4 lore raw
Quoted 6 lines · Yves Crespin
Quoted 4 lines · Christian Bornträger
Quoted 2 lines · Yves Crespin

1/ is-it possible to *really* be synchronize. I prefer to have a blocked write() than use cache and get swap!

Try to mount with the sync option.

exactly async and noatime ?

No. async is exactly the behaviour you dont want. Problem is, the "sync" mount option is not available for every file system. At least ext2, ext3, and ufs support this option. No idea about other filesystems.

Quoted 5 lines
Quoted 3 lines
Quoted 1 line

2/ is-it possible to disable cache disk ?

your copy tool has to support/use O_DIRECT

is O_DIRECT a POSIX option ?

No it is a Linux extension.