Cannot enable cgroup_enable=memory swapaccount=1 on GCE Debian Jessie instance

15,921

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
Share:
15,921

Related videos on Youtube

Thilo-Alexander Ginkel
Author by

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, 2022

Comments

  • Thilo-Alexander Ginkel
    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
    adgud almost 5 years
    What is the purpose of cgroup_enable=memory parameter? It is not documented here: github.com/torvalds/linux/blob/master/Documentation/admin-gu‌​ide/…
  • Tombart
    Tombart almost 5 years
    @adgud Enables hard memory limits for cgroup tasks. Otherwise memory limits are not enforced by kernel.
  • adgud
    adgud almost 5 years
    Are you 100% sure? I've made some tests and this does not seem mandatory to me.