[lxc-users] What happens if container reaches memsw limit

Georg Schönberger gschoenberger at thomas-krenn.com
Tue Jul 21 10:38:29 UTC 2015


Hi LXC team!

Currently we limit the memory of LXC containers with:
lxc.cgroup.memory.limit_in_bytes       = 92160M
lxc.cgroup.memory.memsw.limit_in_bytes = 94208M

We also monitor if the counter hits the limit via memory.memsw.failcnt.

Last week we observed that the failcnt number increased, therefore our
container was hitting the memsw limit several times. The container was
indeed consuming a lot of memory, but most of it (more than 80%) was
used for page cache. Nevertheless the container was swapping, as it is
an Ubuntu container I assume this is due the the high swappiness value
of 60.

# cat /sys/fs/cgroup/memory/lxc/containerX/memory.swappiness 
60

My questions:
1. Are there any problems for container processes, if the container
cannot swap anymore? I would hope the container would free some page
cache if the swap limit was reached, but I am not sure.
2. Does anyone suggest a lower swappiness value? In general I think
swapping is not a problem on our system as we only have SSDs and I took
a look at vmstat. We only had page outs and the number of major page
faults was low.

Host Info:
$ uname -r
3.2.0-87-generic
$ lsb_release -d
Description:	Ubuntu 12.04.5 LTS
$ dpkg -l | grep lxc
hi  lxc                              0.7.5-3ubuntu69
Linux containers userspace tools

Thanks for your help, all the best Georg

-- 
Georg Schönberger
Thomas-Krenn.AG
Web Operations & Knowledge Transfer


More information about the lxc-users mailing list