Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

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.

share|improve this question
2  
Why would you want to limit the disk cache in use? What is your use case? –  Chris Down Apr 23 '13 at 8:45

1 Answer 1

up vote 2 down vote accepted

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.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.