System information
184 System Analysis and Tuning Guide
/proc/sys/vm/vfs_cache_pressure
This variable controls the tendency of the kernel to reclaim the memory which is
used for caching of VFS caches, versus pagecache and swap. Increasing this value
increases the rate at which VFS caches are reclaimed.
It is difficult to know when this should be changed, other than by experimen-
tation. The slabtop command (part of the package procps) shows top
memory objects used by the kernel. The vfs caches are the "dentry" and the
"*_inode_cache" objects. If these are consuming a large amount of memory in re-
lation to pagecache, it may be worth trying to increase pressure. Could also help
to reduce swapping. The default value is 100.
/proc/sys/vm/min_free_kbytes
This controls the amount of memory that is kept free for use by special reserves
including “atomic” allocations (those which cannot wait for reclaim). This should
not normally be lowered unless the system is being very carefully tuned for mem-
ory usage (normally useful for embedded rather than server applications). If
“page allocation failure” messages and stack traces are frequently seen in logs,
min_free_kbytes could be increased until the errors disappear. There is no need
for concern, if these messages are very infrequent. The default value depends on
the amount of RAM.
15.3.2 Writeback Parameters
One important change in writeback behavior since SUSE Linux Enterprise Server 10
is that modification to file-backed mmap() memory is accounted immediately as dirty
memory (and subject to writeback). Whereas previously it would only be subject to
writeback after it was unmapped, upon an msync() system call, or under heavy memo-
ry pressure.
Some applications do not expect mmap modifications to be subject to such writeback
behavior, and performance can be reduced. Berkeley DB (and applications using it)
is one known example that can cause problems. Increasing writeback ratios and times
can improve this type of slowdown.
/proc/sys/vm/dirty_background_ratio
This is the percentage of the total amount of free and reclaimable memory. When
the amount of dirty pagecache exceeds this percentage, writeback threads start
writing back dirty memory. The default value is 10 (%).
/proc/sys/vm/dirty_ratio