Join GitHub today
GitHub is home to over 20 million developers working together to host and review code, manage projects, and build software together.
Running many containers requires bumping up inotify limits #1044
Comments
|
On my system:
And yet I can start more than 128 containers (I don't know how many, I reach Do you know why ? |
|
Interesting. Which version of the lxc userland tools are you using? |
|
lxc version: 0.7.5 On Fri, Jun 28, 2013 at 6:24 PM, Jérôme Petazzoni
Victor VIEUX |
|
Is this still an issue?
|
crosbymichael
closed this
Aug 16, 2013
|
A similar issue can be seen when AUFS finally leaks ~1 million anonymous block devices: the It looks like:
|
|
@EvanKrall are you able to try out a different driver like devicemapper or btrfs to see if you still get the errors? |
|
Once you run the kernel out of anonymous block devices with the AUFS bug, lxc-start has a hard time calling
A reboot will clear this up. I suspect devicemapper doesn't leak anonymous block devices the way AUFS does, but I haven't tested that. |
hamiltont
commented
Mar 12, 2014
|
I've tried both AUFS and devicemapper, and both are unable to run more than 252 containers (each I've already upped |
jeremyeder
commented
Mar 12, 2014
|
For Fedora, we sent this: For Ubuntu, I believe you add a ulimit override to /etc/init/docker.conf: |
This was referenced Oct 29, 2014
ashahba
commented
Jan 17, 2017
|
I ran into the same error but only when attempting to restart docker services and I was able to resolve it with setting: |
jpetazzo commentedJun 27, 2013
It has been reported that it wasn't possible to run more than 118 containers without hitting a inotify limit[1]. We had already met that limit on the dotCloud platform. All you need is to bump up
fs.inotify.max_users_instances, with e.g.:One idea is to display a warning when getting close to the limit; but that is difficult, because it is not possible to cheaply detect how many inotify instances are being used (see [2]).
Another (IMHO better) idea is to parse the output of
lxc-start, and when we seeToo many open files - failed to inotify_init, we could either bump up the limit automatically, or tell the user.I think it is safe to bump up the limit automatically up to a fairly generous number (on the PAAS we use 8192), but not above, because if the Docker host is running another software that leaks inotify instances, we would end up DOS-ing the host by virtually lifting the limit... Not good.
So, to wrap up:
lxc-startfails, parse output, and if we detectinotify_init, display the warning, prompting the user to raise the limit themselves if they want to.[1] https://twitter.com/losnggeneration/status/349973683672059904
[2] http://unix.stackexchange.com/questions/15509/whos-consuming-my-inotify-resources