The disk cache takes too much memory in my OpenVZ VPS. How can I disable or limit disk cache memory usage globally?I am using CentOS 6.4.
How can I disable or limit disk cache memory usage globally?
centos
If you want to decrease the likelihood of VFS caching, increase the VFS cache pressure by tuning the value of /proc/sys/vm/vfs_cache_pressure (the default is 100). This will aggressively reclaim dentries and inodes from memory. 1000 might be a good starting point. On my system a setting of 1000 reduces slab by around 75% or so.Note that this is probably not what you want to do, however. There are very few use cases that you want to reduce filesystem cache memory usage -- it is freed for use by programs as soon as they need it.