Monitoring FileSystem cache
Hi,
Are there tools available to monitor the size of the filesystem buffer/cache ?
Are there hi water marks that limit the size of the buffer cache or does it consume as such memory VM as possible ?
I looked through /proc ( 2.4.20 kernel ) and I don't see anything of interest.
Curious.
Thanks.
J. Donnelly.
Quoted 10 lines
Are there hi water marks that limit the size of the buffer cache or does it consume as such memory VM as possible ?
I looked through /proc ( 2.4.20 kernel ) and I don't see anything of interest.
How about /proc/meminfo?
The buffer cache does not consume as much memory as possible; its size is controlled by a complex policy which is controlled by 9 sysctl variables, which you can find in /proc/sys/vm/bdflush. The policy is implemented in fs/buffer.c. That's the only documentation I know of for those sysctl parameters.
The buffer cache will consume all available memory if there is no other demand for that memory, and this frequently causes people to suspect buffer cache overuse is causing a memory shortage problem. In reality, you rarely have to "turn down" the buffer cache memory usage; it goes down at the right times automatically.
By the way, it's worth mentioning that "the buffer cache" and "filesystem caches" is not the same thing. An individual filesystem driver can cache file data any way it wants. Conventionally, it uses the buffer cache (every popular filesystem driver I know of does), but it could do other things, including using the page cache directly. The page cache itself has no sophisticated allocation strategy like the buffer cache. It competes equally with virtual memory and every other use of memory for the finite real memory.