Re: Moving /tmp to tmpfs makes it useless
2012/6/2 Carlos Alberto Lopez Perez wrote:
> IMHO The logical way of behaving in such situation is to slow-down the
> IO bandwidth of the processes that are filling the cache, by sending to
> sleep any process that requests more IO while the cache is full instead
> of trying to free RAM by swapping out things from the RAM to the swap.
> Do you know any way to avoid (or mitigate) this? Perhaps some sysctl
It's already there and it works that way by default:
/proc/sys/vm/dirty_* files and vm.dirty_* sysctls.
I have the ratio set to 10%, which means, that process will start writing
to disk if it filled 10% of memory (note: not FULL cache, just 10% of
memory is enough to "slow-down" the process).
Of course anybody who don't like these defaults can change them in
See also: http://www.kernel.org/doc/Documentation/sysctl/vm.txt
Linux kernel is usually smart enough,