2005-03-30 13:00:43

by Yves Crespin

[permalink] [raw]
Subject: Disable cache disk

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


Attachments:
crespin.quartz.vcf (295.00 B)

2005-03-30 15:34:09

by Michael Tokarev

[permalink] [raw]
Subject: Re: Disable cache disk

Yves Crespin wrote:
> 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

2005-03-30 15:38:43

by Christian Borntraeger

[permalink] [raw]
Subject: Re: Disable cache disk

On Wednesday 30 March 2005 15:00, Yves Crespin wrote:
> 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.

> 2/ is-it possible to disable cache disk ?

your copy tool has to support/use O_DIRECT

2005-03-31 07:28:37

by Yves Crespin

[permalink] [raw]
Subject: Re: Disable cache disk

Christian Borntr?ger wrote:

>On Wednesday 30 March 2005 15:00, Yves Crespin wrote:
>
>
>>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 ?

>
>
>>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 ?

2005-03-31 08:25:45

by Christian Borntraeger

[permalink] [raw]
Subject: Re: Disable cache disk

Yves Crespin wrote:
> Christian Borntr?ger wrote:
> >On Wednesday 30 March 2005 15:00, Yves Crespin wrote:
> >>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.


> >>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.