Debian 10 (Buster) and Swappiness

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

Debian 10 (Buster) and Swappiness

Gustavo - Emar
Hi,
After upgrading from Debian Stretch to Buster (10), we realize that it is not managing memory as before. 
First, even with Swappiness = 0 and having 32 Ram, (16 Gb using) it starts using Swap, and the system is slow and crashing. 

$ sudo sysctl -a|grep swappiness
vm.swappiness = 0

thanks in advance

Gustavo

Reply | Threaded
Open this post in threaded view
|

Re: Debian 10 (Buster) and Swappiness

andreimpopescu
On Jo, 22 aug 19, 09:21:31, Gustavo - Emar wrote:
> Hi,
> After upgrading from Debian Stretch to Buster (10), we realize that it is
> not managing memory as before.
> First, even with Swappiness = 0 and having 32 Ram, (16 Gb using) it starts
> using Swap

<joke>
If you don't want it using swap you should just disable it.
</joke>

> and the system is slow and crashing.

There's not much information here to even start looking for the root
casue. You might want to start telling us more about the system:

 * Is it identical hardware as used with stretch?
 * What is it used for
 * What init system (systemd, SysV, etc.)
 * How does a crash manifest (only specific software, the whole system,
  etc.)
 * Anything interesting in dmesg/logs/journal
 * etc.

Kind regards,
Andrei
--
http://wiki.debian.org/FAQsFromDebianUser

signature.asc (849 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Debian 10 (Buster) and Swappiness

Reco
        Hi.

On Thu, Aug 22, 2019 at 03:53:55PM +0300, Andrei POPESCU wrote:

> On Jo, 22 aug 19, 09:21:31, Gustavo - Emar wrote:
> > Hi,
> > After upgrading from Debian Stretch to Buster (10), we realize that it is
> > not managing memory as before.
> > First, even with Swappiness = 0 and having 32 Ram, (16 Gb using) it starts
> > using Swap
>
> <joke>
> If you don't want it using swap you should just disable it.
> </joke>

A bad joke, if we're talking a server here ;)


> > and the system is slow and crashing.
>
> There's not much information here to even start looking for the root
> casue. You might want to start telling us more about the system:
>
>  * Is it identical hardware as used with stretch?
>  * What is it used for
>  * What init system (systemd, SysV, etc.)
>  * How does a crash manifest (only specific software, the whole system,
>   etc.)
>  * Anything interesting in dmesg/logs/journal
>  * etc.

I'd like to add that the contents of /proc/meminfo are extremely useful
in such cases.

Reco

Reply | Threaded
Open this post in threaded view
|

Re: Debian 10 (Buster) and Swappiness

bw-2
In reply to this post by Gustavo - Emar
In-Reply-To: <CA rr08=j=[hidden email]>

> Hi,
> After upgrading from Debian Stretch to Buster (10), we realize that it
> is not managing memory as before.
> First, even with Swappiness = 0 and having 32 Ram, (16 Gb using) it
> starts using Swap, and the system is slow and crashing.
>
> $ sudo sysctl -a|grep swappiness
> vm.swappiness = 0
>
> thanks in advance
>
> Gustavo

Hi Gustavo, If the system is slow and crashing, then I think something
went wrong with the upgrade.  I don't recall seeing anything in buster
release notes about changes im memory management, but maybe it could be a
kernel issue?  Is there a backport already on buster?  Not sure, might try
that...

I don't really see any point in trying to tweak swappiness myself.  The
kernel might need swap space for many reasons IIUC.  Here are some links I
saved from yrs past about it.

https://www.linuxjournal.com/article/10678
https://scoutapm.com/blog/understanding-page-faults-and-memory-swap-in-outs-when-should-you-worry
http://northernmost.org/blog/swap-usage-5-years-later/

If it was me, I would look elsewhere.  Maybe try restoring swappiness, and
any other vm.* settings you have tweaked?

Good Luck,
bw

Reply | Threaded
Open this post in threaded view
|

Re: Debian 10 (Buster) and Swappiness

Jochen Spieker
In reply to this post by Reco
Reco:

> On Thu, Aug 22, 2019 at 03:53:55PM +0300, Andrei POPESCU wrote:
>> On Jo, 22 aug 19, 09:21:31, Gustavo - Emar wrote:
>>>
>>> After upgrading from Debian Stretch to Buster (10), we realize that it is
>>> not managing memory as before.
>>> First, even with Swappiness = 0 and having 32 Ram, (16 Gb using) it starts
>>> using Swap
>>
>> <joke>
>> If you don't want it using swap you should just disable it.
>> </joke>
>
> A bad joke, if we're talking a server here ;)
I am not so sure. You could also argue that a system that is actually
using swap is so slow that it might just as well fire the OOM handler
and let it kill random processes. Monitoring will trigger an appropriate
response.

In any case, no system becomes slow or crashes just because it is using
"some" swap. Linux is swapping preemptively. Just because a little swap
space is occupied, that does not mean that the memory content is not
also in RAM. So your system does not necessarily become slower just
because of swap usage.

If a system is actually using swap heavily, with or without swappinness
set to zero, there are most probably runaway processes (or the kernel)
that actually request this much memory. It is possible that different
Linux versions behave differently in such a situations, but in order to
solve this issue I would look for the root cause first.

J.
--
If I could have anything in the world it would have to be more money.
[Agree]   [Disagree]
                 <http://archive.slowlydownward.com/NODATA/data_enter2.html>

signature.asc (849 bytes) Download Attachment