Page MenuHomePhabricator

Enable memory cgroups for default Jessie image
Closed, ResolvedPublic

Description

Running LXC and Docker containers on a Jessie instance requires having memory cgroup support enabled.

Memory cgroups support requires editing /etc/default/grub and reboot:

  • Add "cgroup_enable=memory swapaccount=1" to GRUB_CMDLINE_LINUX
  • Run update-grub2
  • Reboot

If these changes were made to the default Jessie image offered in Labs it would make setting up MediaWiki-Vagrant and/or Docker containers easier for everyone.

Event Timeline

bd808 raised the priority of this task from to Needs Triage.
bd808 updated the task description. (Show Details)
bd808 added a project: Cloud-VPS.
bd808 subscribed.
Restricted Application added subscribers: StudiesWorld, Aklapper. · View Herald Transcript

Change 262838 had a related patch set uploaded (by Andrew Bogott):
Enable memory cgroups for labs debian instances

https://gerrit.wikimedia.org/r/262838

Change 262839 had a related patch set uploaded (by Andrew Bogott):
Labs jessie image: override the debian grub with a copy of our current puppetized grub defaults.

https://gerrit.wikimedia.org/r/262839

Change 262838 merged by Andrew Bogott:
Enable memory cgroups for labs debian instances

https://gerrit.wikimedia.org/r/262838

Change 262839 merged by Andrew Bogott:
Labs jessie image: override the debian grub with a copy of our current puppetized grub defaults.

https://gerrit.wikimedia.org/r/262839

Are you sure cgroup_enable=memory is needed nowadays? An lxc-checkconfig on an unmodified jessie system says "Cgroup memory controller: enabled".

swapaccount=1 is indeed needed (grep MEMCG_SWAP /boot/config-3.16.0-4-amd64 has "# CONFIG_MEMCG_SWAP_ENABLED is not set") as it generates some memory overheads and makes a difference only if you care about your cgroups using all of your swap.

Are you sure cgroup_enable=memory is needed nowadays? An lxc-checkconfig on an unmodified jessie system says "Cgroup memory controller: enabled".

swapaccount=1 is indeed needed (grep MEMCG_SWAP /boot/config-3.16.0-4-amd64 has "# CONFIG_MEMCG_SWAP_ENABLED is not set") as it generates some memory overheads and makes a difference only if you care about your cgroups using all of your swap.

It may indeed be cargo cult configuration. I think I came to this combined set of options based on Google searches for error messages I received when performing vagrant up operations on a jessie testing image. There is a note at https://wiki.debian.org/LXC#Prepare_the_host that seems to read as though memory cgroup support is still disabled by default in jessie but I may be reading this incorrectly and it may instead only apply to pre-jessie distributions. Some or all issues may be caused by the particular way that the Vagrant-LXC provider plugin manages an LXC container.

Andrew claimed this task.

Whether or not we need it, this is done now :)