I have a directory with many files with high access rate. And I need to reduce the cache pressure of this specific directory to prevent other files (like my home directory files) from the pushing out from the filesystem cache. Can I limit filesystem cache for specific directory, or for specific processes or users under Linux ?
You can lock a particular directory (or files) into the filesystem cache/VM subsystem by using the vmtouch utility.
Daemonise and lock all files in a /var/app/data into physical memory:
vmtouch -dl /var/app/data