[Lxc-users] High SLAB

China china at email.it
Fri Aug 24 11:37:00 UTC 2012


Hi,
I've a Centos 6 server with custom kernel 3.3.6 compiled (config from
centos) that contains about 40 lxc.

I have compiled the kernel to resolve (unsuccessfully) an OOM issue. With:
lxc.cgroup.memory.limit_in_bytes = 500M
lxc.cgroup.memory.memsw.limit_in_bytes = 500M
lxc.cgroup.memory.oom_control = 0
when the memory rises above the limit the OOM-Killer sometimes (often) kill
processes outside the container that triggered the limit.

To bypass that issue I have configured the containers like the following:
lxc.utsname = test_oom
lxc.tty = 1
lxc.pts = 1024
lxc.rootfs = /lxc/containers/test_oom
lxc.mount  = /conf/lxc/test_oom/fstab
#networking
lxc.network.type = veth
lxc.network.flags = up
lxc.network.link = br0
lxc.network.name = eth0
lxc.network.mtu = 1500
lxc.network.ipv4 = X.X.X.X/27
lxc.network.hwaddr = xx:xx:xx:xx:xx:xx
lxc.network.veth.pair = veth-xxx
#cgroups
lxc.cgroup.devices.deny = a
# /dev/null and zero
lxc.cgroup.devices.allow = c 1:3 rwm
lxc.cgroup.devices.allow = c 1:5 rwm
# consoles
lxc.cgroup.devices.allow = c 5:1 rwm
# tty
lxc.cgroup.devices.allow = c 5:0 rwm
lxc.cgroup.devices.allow = c 4:0 rwm
lxc.cgroup.devices.allow = c 4:1 rwm
# /dev/{,u}random
lxc.cgroup.devices.allow = c 1:9 rwm
lxc.cgroup.devices.allow = c 1:8 rwm
lxc.cgroup.devices.allow = c 136:* rwm
lxc.cgroup.devices.allow = c 5:2 rwm
# rtc
lxc.cgroup.devices.allow = c 254:0 rwm
# cpu
lxc.cgroup.cpuset.cpus = 3
#mem
lxc.cgroup.memory.limit_in_bytes = 500M
lxc.cgroup.memory.memsw.limit_in_bytes = 500M
*lxc.cgroup.memory.oom_control = 1*
#capabilities
lxc.cap.drop = sys_module mac_override mac_admin

and I've created mine OOM-killer, using  eventfd,
cgroup.event_control, cgroup.procs, memory.oom_control, etc..
That program works great, killing right processes, but now I've a SLAB
cache problem.

Often, after some hours, the containers occupy a lot of SLAB cache (over
100~200MB), specially dentry and ext3_inode_cache. So the kernel doesn't
reclaim the cache like with OOM-killer.
This decreases the limit unpredictably, that become useless!

Each containers has own filesystem in a LV like this:
/dev/mapper/lxcbox--01.mmfg.it--vg-test_oom on /lxc/containers/test_oom
type ext3 (rw)

and is a development server with init, rsyslog, mingetty, apache, ssh and
 crontab.

Someone can help me to understand what I am mistaking or where is the
problem with slab cache unreclaimed?

Thank you!
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.linuxcontainers.org/pipermail/lxc-users/attachments/20120824/2ecf0b71/attachment.html>


More information about the lxc-users mailing list