I am using docker to containerize bunch of services. Some times, containerized services heavily swaps. I've changed vm.swappiness
to 1
via sysctl on my host system. But docker's memory cgroup still have old (default) value of 60. Therefore, all particular containers' cgroups have same value, as parent.
sysctl vm.swappiness
> vm.swappiness = 1
cat /sys/fs/cgroup/memory/docker/memory.swappiness
> 60
cat /sys/fs/cgroup/memory/docker/${CONTAINER_ID}/memory.swappiness
> 60
All attempts to change swappiness manually (by echoing desired value into memory.swappiness
file) fails with permission denied
.
Subject: How can I restrict containers swappiness?
I am using ubuntu 12.04
with kernel 3.13
, my docker version is 1.1.2
with native execution driver (not lxc) of version 0.2
. Kernel is loaded with cgroup_enable=memory swapaccount=1
.