Re: Moving /tmp to tmpfs makes it useless
- To: firstname.lastname@example.org
- Subject: Re: Moving /tmp to tmpfs makes it useless
- From: Serge <email@example.com>
- Date: Sat, 2 Jun 2012 13:04:53 +0300
- Message-id: <CAOVenEpp9XjC7dw8-kTMZwWnMOSAqbkfp6CV9JTz++XO=3tKMQ@mail.gmail.com>
- In-reply-to: <4FC931EC.firstname.lastname@example.org>
- References: <CAOVenEo+CT6Ou_vHq8HvuCz1NdW0Ogq5UqxMZh-4Qkw4e01CsA@mail.gmail.com> <email@example.com> <1337938886.14895.389.camel@pi0307572> <firstname.lastname@example.org> <20120525102037.GC6872@khazad-dum.debian.net> <4FC100D3.email@example.com> <firstname.lastname@example.org> <4FC931EC.email@example.com>
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,