Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

LXC - Cgroup memory controller: missing

I'm trying install LXC (0.7.4.1) on my Debian 6 but when I run the lxc-checkconfig I get "Cgroup memory controller: missing"

root@lxcsrv01:~# lxc-checkconfig
Kernel config /proc/config.gz not found, looking in other places...
Found kernel config file /boot/config-2.6.32-5-686
--- Namespaces ---
Namespaces: enabled
Utsname namespace: enabled
Ipc namespace: enabled
Pid namespace: enabled
User namespace: enabled
Network namespace: enabled
Multiple /dev/pts instances: enabled

--- Control groups ---
Cgroup: enabled
Cgroup namespace: enabled
Cgroup device: enabled
Cgroup sched: enabled
Cgroup cpu account: enabled
Cgroup memory controller: missing
Cgroup cpuset: enabled

--- Misc ---
Veth pair device: enabled
Macvlan: enabled
Vlan: enabled
File capabilities: enabled
enabled

Note : Before booting a new kernel, you can check its configuration
usage : CONFIG=/path/to/config /usr/bin/lxc-checkconfig

According google search I need to recompile my kernel but I don't know how. Someone can explain me how to do this?

Best regards

like image 566
André Bolinhas Avatar asked Mar 24 '13 21:03

André Bolinhas


People also ask

How do I enable cgroup memory?

Enabling the Memory Cgroup To do this, just use your favorite text editor and, with root permissions, add cgroup_enable=memory to the existing list of parameters in /boot/cmdline. txt . Then reboot your Pi with sudo shutdown -r now for the changes to take effect.

How do I add a cgroup?

A new cgroup is created by creating a directory in the cgroup filesystem: mkdir /sys/fs/cgroup/cpu/cg1 This creates a new empty cgroup. A process may be moved to this cgroup by writing its PID into the cgroup's cgroup.

What is memory cgroup?

The memory subsystem of the cgroups feature isolates the memory behavior of a group of processes (tasks) from the rest of the system. It reports on memory resources used by the processes in a cgroup, and sets limits on memory used by those processes.

What is cgroup in Systemctl?

systemd collects related processes into control groups, called cgroups (short for control groups), and manages system resources for the cgroup as a whole. This means resources can be managed per application rather than by the individual processes that make up an application.


2 Answers

The kernel of Debian 6 has no memory cgroup feature. However you can run lxc without it.

If you NEED memory cgroup, it's easy to install the new kernel from backports.

  1. Add apt-line of backports
  2. Run "apt-get install linux-image-3.2.0-0.bpo.4-amd64" (or -686 for i386)
  3. Add a kernel boot option "cgroup_enable=memory" to your bootloader setting (e.g. /etc/default/grub) to enable it.
  4. reboot

Or, if you'd like to re-compile the kernel, you can use kernel-package system of Debian; http://newbiedoc.sourceforge.net/system/kernel-pkg.html

like image 127
sugi Avatar answered Sep 22 '22 23:09

sugi


I am having similar memory cgroup issues, and have looked into it quite a bit. I wrote a blog entry about here:

http://blog.raymond.burkholder.net/index.php?/archives/639-Debian-Stretch-LXC-Memory-Controller.html

In summary, the kernel is compiled with the necessary memory cgroup support. The fly-in-the-ointment: lxc-checkconfig has a bug in it, and will not properly show the status of the memory cgroup. CONFIG_CGROUP_MEM_RES_CTLR=y is applicable for older kernels only (sometime before 3.6, I believe).

I end up making two adjustments: one adjustment to the /boot/config-$version, and one adjustment to /etc/default/grub. Both are explained in the article.

But bottom line, the general recommendation appears to be: don't enable it if you really don't need to perform memory limitation management on containers. There is some performance and memory overhead.

like image 28
Raymond Burkholder Avatar answered Sep 18 '22 23:09

Raymond Burkholder