Low swap usage and swappiness

Hi all,

I’m running a Rancher cluster of RancherOS nodes (0.7.1) with Cattle.
I set up a swap disk on each nodes and I started few dockers on each nodes.
Because those containers need a lot of RAM, the Memory usage of each node reaches more than 90%, causing sometimes unreachable nodes.
But the swap usage is very low (<7% use). How’s that possible? Is the “swappiness” of RancherOS very high and how can I tune RancherOS swappiness?


Heya - I’m surprised - but I haven’t actually looked into it yet.

Could you give us a bit more detail? how are you setting up swap and enabling it, and then what containers are you running?

if we can reproduce your system, then we’ll be sure not to be looking at a similar problem (but not the same as yours)



Thanks for your quick reply. I set up swap on a disk (mkswap /dev/xvdb and swapon /dev/xvdb). Nothing more is configured.
And the containers i’m running are not public containers, so it’s difficult for me to give you my docker-compose :slight_smile: However I can tell you they are all differents (different projects with different technologies), maybe 10 by node, all running Java (with -Xmx properly set).

Is there anything more to set up in order to have swap properly configured? How can I tune swappiness on rancher OS?