1

I want to limit page cache in linux. Some documents say increase vm.vfs_cache_pressure to control the kernel reclaim memory. I try, but not work.

Linux/Documentation/sysctl/vm.txt say "Decreasing vfs_cache_pressure causes the kernel to prefer to retain dentry and inode caches."

Just dentry and inode caches!

I understand Linux kernel parameter vm.vfs_cache_pressure is only by adjusting the allocation of dentry and inode cache of slab memory, there is no relation to the release of the page cache ( buffer cache of file I/O). kswapd reclaim don't care this parameter.

Is this right?

As long as I lookup the source of the kernel with grep vfs_cache_pressure, I got results such as meta-information and dcache in the filesystems, but there is no result in mm subtree.

  • Why are you trying to "limit page cache"? This is generally not something anyone should be attempting. – Michael Hampton Mar 11 '16 at 14:59
  • I want to control the percentage or size of total memory used for page cache. – KOMEDA Shinji Mar 14 '16 at 21:43
  • I understood that already. But that doesn't explain why you are trying to do this. – Michael Hampton Mar 14 '16 at 21:47
  • 1
    I use PostgreSQL on 16 core and 64GB memory system. Linux fill almost free memory as pagecache. When new client connection requests burst, these cause to many direct reclaim and heavy system cpu usage, then the system slow down and terrible response. – KOMEDA Shinji Mar 15 '16 at 7:07

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.