I'm using tmpfs for my /tmp
directory. How can I make the computer decide to swap out the files inside the /tmp
before swapping out anything that is being used by applications?
Basically the files inside /tmp
should have a higher swappiness compared to the memory being used by processes.
It seems this answer https://unix.stackexchange.com/a/90337/56970 makes a lot of sense, but you can't change swappiness for a single directory. I know about cgroups though, but I don't see any way of making tmp into a cgroup?
vm.swappiness=0
– mikeserv Jul 25 '14 at 06:36/tmp
but far more to do with which is swapped first - process memory or pagecache? Becausetmpfs
is mounted page cache. look at this comment at the page linked above. – mikeserv Jul 25 '14 at 06:54