How to set maximum disk cache size?

Ivan Voras ivoras at freebsd.org
Sat Nov 17 01:29:29 PST 2007


On 17/11/2007, Bruce Cran <bruce at cran.org.uk> wrote:
> Ivan Voras wrote:
> > On 16/11/2007, Laszlo Nagy <gandalf at shopzeus.com> wrote:
> >> Ivan Voras wrote:
> >
> >>> http://www.freebsd.org/doc/en_US.ISO8859-1/books/arch-handbook/vm-fileio.html
> >>>
> >> I read this too but I don't understand. Too difficult for me.
> >>
> >> So what is the answer? Do I need to set a sysctl or will FreeBSD use all
> >> available free memory for caching file data from disk?
> >
> > You don't need to change anything, it's the default state.
>
> So as long as the memory isn't shown as "Free" in top, any memory that
> isn't being used by the kernel or by applications is being used for
> cache/buffer?

Yes.

> One reason why I had thought that FreeBSD didn't use all
> the memory for caching disk accesses was because I saw a different
> behaviour when decompressing large archives between Linux and FreeBSD:
> in Linux there's a massive burst of activity as the archive gets put
> straight into memory; then, once memory starts getting full it pauses
> for what seems a very long time as it flushes all the data to disk.
> FreeBSD doesn't seem to do that; it seems a lot smoother in that it
> writes to the disk a lot more regularly - is this likely to be because
> Linux has a higher limit on the number of dirty pages it can have in
> memory before it writes them out to disk?

Yes.


More information about the freebsd-questions mailing list