[CentOS] Effectiveness of CentOS vm.swappiness

Thu Jun 4 22:23:38 UTC 2015
Dennis Jacobfeuerborn <dennisml at conversis.de>

On 04.06.2015 22:18, Markus "Shorty" Uckelmann wrote:
> Hi all,
> This might not be CentOS related at all. Sorry about that.
> I have lots of C6 & C7 machines in use and all of them have the default
> swappiness of 60. The problem now is that a lot of those machines do
> swap although there is no memory pressure. I'm now thinking about
> lowering swappiness to 1. But I'd still like to find out why this
> happens. The only common thing between all those machines is that there
> are nightly backups done with Bacula. I once came across issues with the
> fs-cache bringing Linux to start paging out. Any hints, explanations and
> suggestions would be much appreciated.

If I'd have to venture a guess then I'd say there are memory pages that
are never touched by any processes and as a result the algorithm has
decided that it's more effective to swap out these pages to disk and use
the freed ram for the page-cache.
Swap usage isn't inherently evil and what you really want to check for
is the si/so columns in the output of the "vmstat" command. If the
system is using swap space but these columns are mostly 0 then that
means memory has been swapped out in the past but there is no actual
swap activity happening right now and there should be no performance
impact. If however these numbers are consistently larger than 0 then
then that means the system is under acute memory pressure and has to
constantly move pages between ram and disk and that will have a large
negative performance impact on the system. This is the moment when swap
usage becomes bad.