I have a Debian squeeze kernel (linux-image-2.6.32-5-openvz-amd64) which according to the Doku should support cgroups. When I look into the kernel configuration, it does (or is some other kernel configuration required?)
# zgrep -i cgroup /boot/config-2.6.32-5-openvz-amd64
# CONFIG_CGROUP_SCHED is not set
CONFIG_CGROUPS=y
# CONFIG_CGROUP_DEBUG is not set
CONFIG_CGROUP_DEVICE=y
CONFIG_BLK_CGROUP=y
# CONFIG_DEBUG_BLK_CGROUP is not set
CONFIG_NET_CLS_CGROUP=y
Also, according to http://wiki.debian.org/LXC, a kernel parameter cgroup_enable=memory might be necessary. I started the kernel with it:
# cat /proc/cmdline
BOOT_IMAGE=/boot/vmlinuz-2.6.32-5-openvz-amd64 root=UUID=6332fe39-7eaa-4519-b6c1-e05808284586 ro cgroup_enable=memory quiet console=ttyS0,57600n8
However, the system still has no cgroup support! The cgroup file system cannot be mounted as the file system type is not even known to the system:
# mount -t cgroup none /cgroup
mount: unknown filesystem type 'cgroup'
and:
# grep -i cgroup /proc/filesystems
#
So there is either a bug or I miss something. Can anyone tell me what? Is there a kernel parameter missing? A kernel configuration?
You have to pass an -o to tell it what to mount.
And that's assuming that /sys/fs/cgroup is mounted at all.
Ubuntu has a package named cgroup-lite which can do all this at boot. It doesn't appear to be in Debian so I'm not sure what the equivalent might be.
Note: I cannot add comments so I have to simply answer your question this way. For example: I wanted to ask if you had checked your kernel logs (dmesg | grep cgroup).
You should mount like that[1]:
cgroup_subsystem can be[2]: {blkio, cpu, cpuacct, cpuset, devices, freezer, memory, net_cls, net_prio, ns}
You can also mount cgroups with the help of fstab (static information about the filesystems). Add this line to /etc/fstab to mount it at system boot with default cgroup subsystems.
It depends on your distribution and kernel version. You can use following script from Docker to test
cgroups
and container related features: