27 October, 2021

Plesk

liton

608 views


 In /etc/nginx/nginx.conf

changed it from 1024 to 2048. as you wish.

There is following formula for determining nginx worker_processes and worker_connections:

max_clients = worker_processes * worker_connections

Where worker_processes [number of processor cores], for instance:

# cat /proc/cpuinfo |grep processor
processor : 0
processor : 1
processor : 2
processor : 3
processor : 4
processor : 5

So,

worker_processes 6;

Thus, you can calculate the desired value for worker_connections

 

pls. consider to check your serverwide nginx configuration "/etc/nginx/nginx.conf". You have the choice to define your very own settings, as for example:

Code:
    user  nginx;
    worker_processes  4;

    worker_rlimit_nofile 64000;

    error_log  /var/log/nginx/error.log  warn;

    pid        /var/run/nginx.pid;

    include /etc/nginx/modules.conf.d/*.conf;

    events {
    worker_connections  4096;
    }

...
... where "worker_processes" could match the available cores

Example command to show the cores on your server:
Code:
grep processor /proc/cpuinfo | wc -l



... and "worker_rlimit_nofile" could match the "open - files - limit" settings from "/etc/security/limits.conf" for the system - user "nginx"

Example entries:
Code:
nginx           soft    nofile          64000
nginx           hard    nofile          64000



... and the standart setting for "worker_connections" ( 1024 ) can be multiplied with the numbers of your cores ( 4x1024 = 4096 ).​
 
source: 
https://talk.plesk.com/threads/500-internal-server-error-nginx.343163/