Plesk Onyx for Linux
kb: technical
ABT: Group B
Applicable to:
- Plesk Onyx for Linux
Symptoms
- The high CPU usage by Nginx can be found in Plesk > Health Monitoring.
- Many Nginx processes as below can be found on the server:
# top -c
19296 nginx 20 0 318720 223848 2212 S 0.3 2.1 0:00.23 nginx: worker process
# top -c
19289 nginx 20 0 318720 223848 2212 S 0.3 2.1 0:00.23 nginx: worker process is shutting down
Cause
Incorrect value of worker_connections
directive.
Resolution
- Log into the server via SSH.
-
Create a backup for Nginx configuration file:
# cp /etc/nginx/nginx.conf{,.orig}
- Get the number of CPU cores (in the example below this value is equal to 4):
# cat /proc/cpuinfo | grep processor | wc -l
4 - Using the vi text editor open the
/etc/nginx/nginx.conf
file and change the value for theworker_connections
equals to 1024 * number of CPU cores:CONFIG_TEXT: worker_connections 4096;
-
Restart the Nginx service to apply changes:
# service nginx restart
Comments
6 comments
nothing changed for me
Hello Pitt Hitt,
In case the issue persists after applying the steps above, could you please submit a request to Plesk support that we can check this case
I have the same problem, and nothing changed after increasing it... is there any other solution for this problem?
Try this:
sudo nano /lib/systemd/system/nginx.service
sudo systemctl daemon-reload
sudo service nginx restart
Also add to nginx.conf:
worker_shutdown_timeout
5(or 10/15...)
Nothing changes after updating worker process in nginx.conf file
The updated nginx.conf file shows
If i run
Output still shows 1024
Hello @Christopher Mulholland,
The "ulimit -n" command shows the configured limit for open files, it is not related to the worker_connections Nginx directive.
Please sign in to leave a comment.