How to set maximum disk cache size?

Ivan Voras ivoras at freebsd.org
Fri Nov 16 05:43:52 PST 2007


Bruce Cran wrote:
> Wojciech Puchar wrote:
>> Laszlo wrote:
>>> Hi All,
>>>
>>> Is there a way (sysctl?) to tell FreeBSD (6.2 RELEASE) how many
>>> memory can it use for caching file data from disk?
>>>
>>> It might be that FreeBSD will use all available RAM, and reduce the
>>> cache 
>> it already does
> 
> It may seem strange since it's generally accepted that you can never
> have enough disk cache, but FreeBSD apparently doesn't actually use all
> the free memory for caching.  By default it uses up to 256MB for

This is wrong. See
http://www.freebsd.org/doc/en_US.ISO8859-1/books/arch-handbook/vm-fileio.html


"""FreeBSD reserves a limited amount of KVM to hold mappings from struct
bufs, but it should be made clear that this KVM is used solely to hold
mappings and does not limit the ability to cache data. """



More information about the freebsd-questions mailing list