8

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?

Tombart
  • 2,143
  • 3
  • 27
  • 48

1 Answers1

7

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
Tombart
  • 2,143
  • 3
  • 27
  • 48
  • What is the purpose of `cgroup_enable=memory` parameter? It is not documented here: https://github.com/torvalds/linux/blob/master/Documentation/admin-guide/kernel-parameters.txt – adgud Jul 11 '19 at 13:48
  • @adgud Enables hard memory limits for `cgroup` tasks. Otherwise memory limits are not enforced by kernel. – Tombart Jul 12 '19 at 12:34
  • Are you 100% sure? I've made some tests and this does not seem mandatory to me. – adgud Jul 14 '19 at 11:02