I use docker to containerize a bunch of services. Container services change a lot several times. I changed vm.swappiness to 1 via sysctl on my host system. But the docker memory group still has the old (default) value of 60. Therefore, all groups of individual containers have the same value as the 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 repeating the desired value in the memory.swappiness file) fail with permission denied .
Subject: How can I limit the swappiness of containers?
I am using ubuntu 12.04 with kernel 3.13 , my version of docker is 1.1.2 with its own runtime driver (not lxc) version 0.2 . The kernel is loaded using cgroup_enable=memory swapaccount=1 .
source share