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

Sensible default for NGINX_WORKER_CONNECTIONS #28

Closed
kykc opened this Issue Feb 26, 2017 · 2 comments

Comments

Projects
None yet
3 participants
@kykc

kykc commented Feb 26, 2017

Regarding nginx worker connections limit, as defined here:

Querying ulimit from inside the container:

root@abc201f5e274:/# ulimit -n
1048576

I don't think it's rather sensible default value, as it greatly affects memory footprint: on 8-thread processor I got 8 workers each consuming 404MiB of RES memory for nginx alone, which is quite excessive IMO.

In any case, I think it's a good thing to mention that this option greatly affects memory consumption of the container in README.md

Update

Can't find info about docker run behavior when --ulimit is not present, but seems that docker sets such ulimit inside all containers on my host for some reason. On the host itself ulimit has pretty usual value:

kykc@yes:~$ ulimit -n
1024
@ShockwaveNN

This comment has been minimized.

Member

ShockwaveNN commented Feb 27, 2017

You can use env variables:
NGINX_WORKER_PROCESSES - to set nginx worker process
NGINX_WORKER_CONNECTIONS - to set max connetion for each worker
Also you can change ulimit by docker --ulimit key - see https://docs.docker.com/engine/reference/commandline/run/#/set-ulimits-in-container---ulimit
We will add info about that in manuals, thanks.

@agolybev

This comment has been minimized.

Contributor

agolybev commented Feb 27, 2017

Added nginx params description. See Available Configuration Parameters section for details.

@agolybev agolybev closed this Feb 27, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment