[GH-ISSUE #28] Sensible default for NGINX_WORKER_CONNECTIONS #18

Closed
opened 2026-02-26 09:35:02 +03:00 by kerem · 2 comments
Owner

Originally created by @kykc on GitHub (Feb 26, 2017).
Original GitHub issue: https://github.com/ONLYOFFICE/Docker-DocumentServer/issues/28

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
Originally created by @kykc on GitHub (Feb 26, 2017). Original GitHub issue: https://github.com/ONLYOFFICE/Docker-DocumentServer/issues/28 Regarding nginx worker connections limit, as defined [here](https://github.com/ONLYOFFICE/Docker-DocumentServer/blob/master/run-document-server.sh#L25): 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 ```
kerem closed this issue 2026-02-26 09:35:02 +03:00
Author
Owner

@ShockwaveNN commented on GitHub (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.

<!-- gh-comment-id:282649202 --> @ShockwaveNN commented on GitHub (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.
Author
Owner

@agolybev commented on GitHub (Feb 27, 2017):

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

<!-- gh-comment-id:282652176 --> @agolybev commented on GitHub (Feb 27, 2017): Added nginx params description. See [Available Configuration Parameters](https://github.com/ONLYOFFICE/Docker-DocumentServer#available-configuration-parameters) section for details.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/Docker-DocumentServer-ONLYOFFICE#18
No description provided.