Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replace nproc with pids limit #1110

Open
ejholmes opened this issue Oct 10, 2017 · 0 comments
Open

Replace nproc with pids limit #1110

ejholmes opened this issue Oct 10, 2017 · 0 comments
Assignees

Comments

@ejholmes
Copy link
Contributor

Support for configuring the nproc limit was added in #761, however, I don't think it's ever actually worked the way it was intended.

From the docker run docs:

Be careful setting nproc with the ulimit flag as nproc is designed by Linux to set the maximum number of processes available to a user, not to a container. For example, start four containers with daemon user:

$ docker run -d -u daemon --ulimit nproc=3 busybox top

$ docker run -d -u daemon --ulimit nproc=3 busybox top

$ docker run -d -u daemon --ulimit nproc=3 busybox top

$ docker run -d -u daemon --ulimit nproc=3 busybox top

The 4th container fails and reports “[8] System error: resource temporarily unavailable” error. This fails because the caller set nproc=3 resulting in the first three containers using up the three processes quota set for the daemon user.

I ran into this behavior when attempting to enable user namespace remapping. Recent versions of Docker support a more granular alternative that's cgroup aware: moby/moby#18697

Unfortunately, this doesn't seem to be supported in ECS yet, but I think a good alternative for the time being would be to add a flag to Empire that allows it to start in a user namespace compatibility mode so that nproc is disabled.

@ejholmes ejholmes self-assigned this Oct 10, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant