Plesk

High CPU usage by Nginx is shown in Health Monitor

Symptoms

Cause

Incorrect value of worker_connections directive.

Resolution

  1. Log into the server via SSH.
  2. Create a backup for Nginx configuration file:

    # cp /etc/nginx/nginx.conf{,.orig}

  3. Get the number of CPU cores (in the example below this value is equal to 4):

    # cat /proc/cpuinfo | grep processor | wc -l
    4

  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:

    worker_connections 4096;

  5. Restart the Nginx service to apply changes:

    # service nginx restart

Exit mobile version