有没有办法告诉操作系统(2.6.18-194.el5)在inode缓存上使用24GB可用RAM比在文件缓存上更多?我已经查看了/ proc / etc / vm / vfs_cache_pressure但它似乎并不是我正在寻找的…
解决方法
根据 Documentation for /proc/sys/vm/*,这应该做你想要的:
vfs_cache_pressure
This percentage value controls the tendency of the kernel to reclaim
the memory which is used for caching of directory and inode objects.At the default value of vfs_cache_pressure=100 the kernel will attempt
to reclaim dentries and inodes at a “fair” rate with respect to
pagecache and swapcache reclaim. Decreasing vfs_cache_pressure causes
the kernel to prefer to retain dentry and inode caches. When
vfs_cache_pressure=0,the kernel will never reclaim dentries and
inodes due to memory pressure and this can easily lead to
out-of-memory conditions. Increasing vfs_cache_pressure beyond 100
causes the kernel to prefer to reclaim dentries and inodes.Increasing vfs_cache_pressure significantly beyond 100 may have negative performance impact. Reclaim code needs to take varIoUs locks to find freeable directory and inode objects. With vfs_cache_pressure=1000,it will look for ten times more freeable objects than there are.