Getting "512 worker_connections are not enough" on High Load #1316
-
Hey! were using NPMPlus for 23 Proxy and 11 Stream Hosts. I found that there is an setting in the ngnix.conf file, but i think when ive edit this file, on the next update it will be changed to default!? Also there is an option that nginx can handle the worker_connection itselfs. Can he have an ENV option for Settings? Or any otherway? |
Beta Was this translation helpful? Give feedback.
Replies: 14 comments 4 replies
-
which exactly?
if nginx can do this automatic then I would do this, if not then it depends if increasing this value has any downsides, if not then I can jsut increase the default |
Beta Was this translation helpful? Give feedback.
-
https://www.sabatino.dev/misconfigured-nginx-worker_connections-caused-downtime/ I went to the nginx docs to read up about this parameter, and by default this was configured to 512. Because of our many simultaneous websocket connections, we were effectively hitting the 512 limit, and NGINX was not configured to increase the worker_processes, so when our application server would hit this limit, it stopped accepting any new incoming requests. I resolved this by increasing our worker_connections to 768 and I changed the worker_processes configuration from 1 to auto, so nginx would add extra workers if needed.
|
Beta Was this translation helpful? Give feedback.
-
the default for one of the values should already be auto: |
Beta Was this translation helpful? Give feedback.
-
Ah okay, thats the setting for allocating all CPU Cores - thats good. |
Beta Was this translation helpful? Give feedback.
-
It should use the value written in nginx docs |
Beta Was this translation helpful? Give feedback.
-
So can we change the value via "/data/nginx_custom/events.conf" or gets that file also an "reset" when updating? |
Beta Was this translation helpful? Give feedback.
-
Ive changed the "/data/nginx_custom/events.conf" with "worker_connections 768;" and restartet the container, actually it started, but i dont know if that really changed anything ... do you know a way to check the current loaded config or get the actual worker_connections? |
Beta Was this translation helpful? Give feedback.
-
|
Beta Was this translation helpful? Give feedback.
-
thats saadly only the output of all configs loaded, so only the "include /data/nginx_custom/events.conf;" is in the output, not if the process really uses the changed "worker_connections" value :-/ But okay, ill test it after the holidays, when next time all users are in the office :-) ill report again! Thanks for your help and merry christmas! |
Beta Was this translation helpful? Give feedback.
-
Do you think increasing worker_connections by default is a bad idea? Any many thanks! |
Beta Was this translation helpful? Give feedback.
-
Puuuh, i dont know if its needed for all installations. My machine has only 1 CPU Core, but that wasnt the problem, cpu load is at ~5-10% at this time when ive got the "512 worker_connections are not enough" errors. |
Beta Was this translation helpful? Give feedback.
-
The total connections are calculated by processes*connection, so doubling the cpu cores would double the total connections |
Beta Was this translation helpful? Give feedback.
-
Aha, okay ... But i think for the most installations with more then one CPU Core it shouldt be an problem. |
Beta Was this translation helpful? Give feedback.
-
I will convert this to a discussion |
Beta Was this translation helpful? Give feedback.
Ive changed the "/data/nginx_custom/events.conf" with "worker_connections 768;" and restartet the container, actually it started, but i dont know if that really changed anything ... do you know a way to check the current loaded config or get the actual worker_connections?