Can't start more than 35 containers on my machine
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
lxc (Ubuntu) |
Fix Released
|
High
|
Serge Hallyn |
Bug Description
Doing some load testing on LXC, I noticed that I'm unable to start more than 35 containers on my machine.
The limitation is apparently inotify and the utmp inotify watch:
lxc-start 1331084250.970 NOTICE lxc_conf - 'test40' is setup.
lxc-start 1331084250.970 NOTICE lxc_start - exec'ing '/sbin/init'
lxc-start 1331084250.970 NOTICE lxc_start - '/sbin/init' started with pid '20939'
lxc-start 1331084251.275 ERROR lxc_utmp - Too many open files - failed to inotify_init
lxc-start 1331084251.275 ERROR lxc_start - failed to add utmp handler to mainloop
lxc-start 1331084251.275 ERROR lxc_start - mainloop exited with an error
lxc-start 1331084251.276 DEBUG lxc_cgroup - get_init_cgroup: found init cgroup for subsys (null) at /
lxc-start 1331084251.276 DEBUG lxc_cgroup - destroying /sys/fs/
lxc-start 1331084251.276 ERROR lxc_cgroup - Device or resource busy - failed to remove cgroup '/sys/fs/
Which seems odd as we're not supposed to use that in 12.04 now that we have the kernel patch right?
Related branches
Changed in lxc (Ubuntu): | |
assignee: | nobody → Serge Hallyn (serge-hallyn) |
status: | Confirmed → In Progress |
> lxc-start 1331084251.275 ERROR lxc_utmp - Too many open files - failed to inotify_init
Note I don't know that just stopping utmp watching will help this, however,
> lxc-start 1331084251.275 ERROR lxc_start - failed to add utmp handler to mainloop cgroup/ cpuset/ /lxc/test40 cgroup/ cpuset/ /lxc/test40'
> lxc-start 1331084251.275 ERROR lxc_start - mainloop exited with an error
> lxc-start 1331084251.276 DEBUG lxc_cgroup - get_init_cgroup: found init cgroup for subsys (null) at /
>
>
> lxc-start 1331084251.276 DEBUG lxc_cgroup - destroying /sys/fs/
>
> lxc-start 1331084251.276 ERROR lxc_cgroup - Device or resource
> busy - failed to remove cgroup '/sys/fs/
>
>
> Which seems odd as we're not supposed to use that in 12.04 now that we have the kernel patch right?
Well this is embarassing.
The code to check whether utmp needs to be checked is run in a thread cap_sys_ boot() earlier and cache its results in the
which is actually cloned from the code which uses it. We need to
run must_drop_
handler for both lxc_poll() and the do_start() which is run by a new
thread in lxc_spawn().
So, the check of must_drop_ cap_sys_ boot() should be run right before
lxc_spawn() is called in __lxc_start(), the results cached in
handler->conf, and used in do_start() (to decide whether to drop
caps) and lxc_poll() (to decide whether to watch utmp).
I can do this next week if you don't get to it first.