Linode kernel with memory cgroup

I'm running Docker in a Linode with Ubuntu 14.04 LTS with 4.0.1-x86_64-linode55 kernel.

I want Docker to be able to gather memory metrics, per the docs:

https://docs.docker.com/installation/ub … accounting">https://docs.docker.com/installation/ubuntulinux/#adjust-memory-and-swap-accounting

I need to add "cgroup_enable=memory swapaccount=1" options. But it seems that to be able to add those options I need to use a custom kernel?

Is there another Linode kernel which has these options enabled? Can I achieve this without using a custom kernel?

6 Replies

The downside here is that memory/swap cgroups involve a perf hit, even for people who aren't actually doing anything with them. Historically, Linode has maintained a single kernel line, so enabling an option in their kernel that will affect perf for every Linode user running the default kernel (which I suspect is a lot of them) is a choice that can't be made lightly.

  • Les

I understand. So the only option is to use a custom kernel then?

Unless Linode enables the option (possible) or starts maintaining multiple kernel "tracks", with the option enabled in one of them (also possible, but probably less likely).

FWIW, custom kernels really aren't bad once you get some tooling built for managing it. Though I may be biased because I wrote tooling already and have forgotten it :P

shamelessplug

https://github.com/akerl/roller

https://github.com/dock0/kernel

  • Les

@akerl that looks interesting! Would you happen to have a blog post, or be willing to post some minimal Linode specific instructions for me? Or any link at all would be useful.

If swapping in a custom kernel, I'd preferably also add aufs support for docker (devicemapper has been proving to be a pain in the ass).

shinji: I run kernels built from those configs on all my Linodes. As a warning, I'm running a fairly custom userspace (Arch-based, read-only, http://blog.akerl.org/2014/12/17/dock0-round-2/ for more details)

honi: I don't really have a kernel-specific blog post, but really all you need for custom kernels are a vmlinuz kernel file and a /boot/grub/menu.lst. You don't even need the grub package installed, since when you set your Config Profile to use pv-grub, pv-grub just reads the menu.lst itself. I template my menu.lst with some ruby ERB templates (https://github.com/dock0/vm_install/blo … b/menu.lst">https://github.com/dock0/vm_install/blob/master/templates/boot/grub/menu.lst) but the final product is just this:

timeout 25
default 0

title latest
root (hd0)
kernel /latest/kernel rootfspath=/latest/vm_root
initrd /latest/initrd

A regular menu.lst for non-crazy userspace would be a bit different, something like:

timeout 25
default 0

title latest
root (hd0)
kernel /boot/vmlinuz root=/dev/xvda

I'd highly recommend using overlayfs rather than aufs or devicemapper for your Docker storage backend. In my experience, AUFS manifests some weird bugs over time, and overlayfs has the benefit of being in the mainline kernel.

  • Les

@honi:

If swapping in a custom kernel, I'd preferably also add aufs support for docker (devicemapper has been proving to be a pain in the ass).

Try btrfs with docker, I find it works better than aufs and devicemapper

Reply

Please enter an answer
Tips:

You can mention users to notify them: @username

You can use Markdown to format your question. For more examples see the Markdown Cheatsheet.

> I’m a blockquote.

I’m a blockquote.

[I'm a link] (https://www.google.com)

I'm a link

**I am bold** I am bold

*I am italicized* I am italicized

Community Code of Conduct