-1

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 ?

2
  • How are these files accessed? Be as precise as possible. May 1, 2013 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. May 2, 2013 at 5:15

1 Answer 1

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
5
  • That's the opposite of what the OP is asking for. May 1, 2013 at 18:00
  • 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 1, 2013 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 1, 2013 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 1, 2013 at 18:11
  • @s9gf4ult Why do you want to limit it?
    – ewwhite
    May 4, 2013 at 4:51

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .