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 ?
Asked
Active
Viewed 1,497 times
-1
-
How are these files accessed? Be as precise as possible. – David Schwartz May 01 '13 at 17:58
-
You're not going to get useful answers if you don't explain precisely how the files are accessed. The solution will be to prevent that access from pushing other things out of cache. How that's done depends on what that access *is*. – David Schwartz May 02 '13 at 05:15
1 Answers
0
You can lock a particular directory (or files) into the filesystem cache/VM subsystem by using the vmtouch utility.
Example:
Daemonise and lock all files in a /var/app/data into physical memory:
vmtouch -dl /var/app/data

ewwhite
- 197,159
- 92
- 443
- 809
-
-
I dont need caching of partucular direcotory, I need to limit caching the particular directory, to specify how many megabytes of this directory files be in the cache. Or maybe limit the cacheing by process touching this files. – s9gf4ult May 01 '13 at 18:07
-
Think *include* versus *exclude*. Include the things that need to be cached (the particular directory) and lock them in cache so that they are not pushed out by insignificant files. – ewwhite May 01 '13 at 18:07
-
I dont have particular directory I need to include in cache, I have a directory which I need to limit. – s9gf4ult May 01 '13 at 18:11
-