Moby: Debian stock kernel doesn't support limiting memory

Created on 11 Apr 2013  ·  7Comments  ·  Source: moby/moby

Docker testing harness fails in Debian as its kernel does not support cgroup memory limitation. Although the following patch in the Debian kernel config will enable named support, this is not yet part of the official kernel package

--- /boot/config-3.2.0-4-amd64 2013-02-27 01:21:37.000000000 -0800
+++ config-3.2.0-4-amd64 2013-04-02 19:23:20.661887146 -0700
@@ -128,9 +128,9 @@
CONFIG_CGROUP_CPUACCT=y
CONFIG_RESOURCE_COUNTERS=y
CONFIG_CGROUP_MEM_RES_CTLR=y
-CONFIG_CGROUP_MEM_RES_CTLR_DISABLED=y
+# CONFIG_CGROUP_MEM_RES_CTLR_DISABLED is not set
CONFIG_CGROUP_MEM_RES_CTLR_SWAP=y
-# CONFIG_CGROUP_MEM_RES_CTLR_SWAP_ENABLED is not set
+CONFIG_CGROUP_MEM_RES_CTLR_SWAP_ENABLED=y
CONFIG_CGROUP_PERF=y
CONFIG_CGROUP_SCHED=y
CONFIG_FAIR_GROUP_SCHED=y

Most helpful comment

for any other poor non-bearded noobs like me wondering how to do this...
http://askubuntu.com/a/19487/62915

  1. add cgroup_enable=memory swapaccount=1 to whatever is currently in the GRUB_CMDLINE_LINUX_DEFAULT var in /etc/default/grub
  2. sudo update-grub to make it ready to use
  3. restart the instance, should be working

All 7 comments

This issue relates with packaging issue #251

This should probably be reported to the Debian project so they can fix it.

@creack: It works. Thank you!

@unclejack: I did more research on this to present it to Debian, and it turns out that although the stock kernel doesn't support limiting memory, it does support setting kernel boot parameters to enable it. The parameter settings are:

cgroup_enable=memory swapaccount=1

In summary for this issue, Debian users can fully enjoy docker passing all its tests with standard Wheesy kernel adding the following parameters into their /boot/grub/grub.cfg:

linux /boot/vmlinuz-3.2.0-4-amd64 [other parameters] cgroup_enable=memory swapaccount=1

This implies that with good documentation, Debian Wheesy with no special packages fully support Docker

Crossposting this issue to the Debian docker package, issue #251

just for information to anyone coming here, the standard way in debian to add these options if you want them to persist when the kernel package is updated or the initrd is regenerated, is to add them to GRUB_CMDLINE_LINUX_DEFAULT in /etc/default/grub

for any other poor non-bearded noobs like me wondering how to do this...
http://askubuntu.com/a/19487/62915

  1. add cgroup_enable=memory swapaccount=1 to whatever is currently in the GRUB_CMDLINE_LINUX_DEFAULT var in /etc/default/grub
  2. sudo update-grub to make it ready to use
  3. restart the instance, should be working
Was this page helpful?
0 / 5 - 0 ratings