[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Swappiness in Buster



On 06/07/2020 18:11, songbird wrote:
> Martin Reissner wrote:
> 
>> Hello,
>>
>> ever since upgrading machines to Buster the vm.swappiness sysctl
>> parameter doesn't seem to do anything anymore and regardless on how I
>> set it via sysctl or directly in /proc the system behaves as it would
>> have a pretty high swappiness and thus is swapping out quite a bit under
>> load, using the memory mostly for buff/cache.
>>
>> To make this clear, I'm seeing no performance degradation and there is
>> not much swapping in done, I'm merely wondering why this behaviour has
>> changed and if there's a way to make it work as before again. Also I'd
>> be happy to know if anybody else is experiencing this as Buster has been
>> out for a while now and I found some information on this ie. other users
>> reporting the same issue, but not really a lot.
>>
>> Now if you're asking why I would configure swap if I don't want it to be
>> used, the answer is monitoring and failsafe. I usually set the
>> swappiness to 1 so to only swap if the box runs out of memory and then
>> trigger an alarm to let us know something is up. This is much more
>> convenient than the oomkiller striking down a mysqld process just
>> because it was allowed to use a bit too much memory.
> 
>   i haven't noticed any issues with my desktop system set
> to 5, but i rarely if ever get much swapping going on 
> anyways.  i'm not using buster but using testing.
> 
>   if you are running a database oriented server i think
> the recommendation would be to set it to 0 or 1.
> 
> 
>   songbird
> 


Yeah, only talking about server and mostly database applications. I
usually set it to 1, but even tried 0 which disabled swap completely on
Stretch but on Buster it didn't make a difference at all, the setting
seems to be ignored while using default swappiness (60?) since Buster.

Following output is from a mariadb server that didn't swap at all
running Stretch.

root@server:~# cat /proc/sys/vm/swappiness
1
root@server:~# free -tm
              total     used     free   shared  buff/cache   available
Mem:          48284     9763      707       59       37814       38147
Swap:         11443     5020     6423
Total:        59728    14783     7131


Reply to: