Cannot enable cgroup_enable=memory swapaccount=1 on GCE Debian Jessie instance
Update /etc/default/grub
and set:
GRUB_CMDLINE_LINUX="cgroup_enable=memory swapaccount=1"
run update-grub && reboot
Instead of docker info
(which seems to be buggy) use rather lxc-checkconfig
or check-config.sh from Docker (moby) repository:
wget https://raw.githubusercontent.com/moby/moby/master/contrib/check-config.sh && bash check-config.sh
Related videos on Youtube
Thilo-Alexander Ginkel
Geek by passion. Software enthusiast. Freelance software developer (Spring Boot, Java) with over 20 years of experience in software development.
Updated on September 18, 2022Comments
-
Thilo-Alexander Ginkel over 1 year
In order to support Docker memory limits / quotas I'd like to enable the
cgroup_enable=memory swapaccount=1
Linux kernel command line options on my Debian Jessie Google Cloud Compute Engine instances. After adding them to
/etc/default/grub
, updating and rebooting I can see the options being active in/proc/cmdline
:BOOT_IMAGE=/boot/vmlinuz-3.16.0-4-amd64 root=UUID=aeb374a4-1a04-4ed7-adac-d5c57b350575 ro console=ttyS0,38400n8 elevator=noop cgroup_enable=memory swapaccount=1
However,
docker info
still complains about them being disabled:$ docker info [...] WARNING: No kernel memory limit support WARNING: No cpu cfs quota support WARNING: No cpu cfs period support [...]
Any ideas? Has the kernel included with the GCE Debian image built without support for these features?
-
adgud almost 5 yearsWhat is the purpose of
cgroup_enable=memory
parameter? It is not documented here: github.com/torvalds/linux/blob/master/Documentation/admin-guide/… -
Tombart almost 5 years@adgud Enables hard memory limits for
cgroup
tasks. Otherwise memory limits are not enforced by kernel. -
adgud almost 5 yearsAre you 100% sure? I've made some tests and this does not seem mandatory to me.