How to persistently set Nginx's worker processes?
I'm trying to set worker_processes to auto, but it keeps being reverted. I know that certain directives can be set in ea-nginx/settings.json, but worker_processes doesn't appear to be one of them and setting it in conf.d/modules/*.conf doesn't take precedence from the tests I've ran.
Is there any way to set that or override other core Nginx directives that are not supported in settings.json?
cPanel/WHM version 11.106.0.9, Nginx version 1.23.1
-
Hey there! Have you tried using the details under the Global Configuration in this section? NGINX with Reverse Proxy | cPanel & WHM Documentation This will let you create configuration files that area read globally for all accounts. 0 -
Hey there! Have you tried using the details under the Global Configuration in this section? Core functionality Tried adding a code block here to show the top 15 lines of /etc/nginx/nginx.conf, but getting a 403 upon submitting a post reply with it. I noticed that worker_connections seems to be preserved when set to a custom setting, but worker_processes is still reverted back to 1. I had changed worker_processes to auto again and worker_connections's 1024 to 4096, but only the former was reverted. Being able to adjust this directive is a pretty integral part of configuring Nginx so I believe cPanel should look at incorporating some form of managing more of the configuration natively.
0 -
I'm not finding much on my end for this. Could you create a ticket with our team so we can do a bit more research on this for you? 0 -
I have the same problem. How to set Worker Processes ?? I just can have 1, like for one CPU Core. Manual says one Worker per CPU core but the setting in /etc/nginx.conf keeps reverting. 0 -
@Thimempapa - there's no way to make that change at this time. Could you submit a feature request for that using the link in my signature? 0 -
There"s a solution now. after contacting support, this here work for me: # cp -vi /etc/nginx/nginx.conf{,.bkp} # cat /etc/nginx/ea-nginx/settings.json { "apache_port" : "81", "apache_port_ip" : "127.0.0.1", "apache_ssl_port" : "444", "apache_ssl_port_ip" : "127.0.0.1", "client_max_body_size" : "128m", "worker_processes" : "2" } After "worker_processes" : "2" has been appended to /etc/nginx/ea-nginx/settings.json as outlined above, you would also need to rebuild the configuration: /scripts/ea-nginx config --all Then you can verify the worker_processes is retained in the NGINX configuration with the following commands: # cat /etc/nginx/ea-nginx/settings.json { "apache_port" : "81", "apache_port_ip" : "127.0.0.1", "apache_ssl_port" : "444", "apache_ssl_port_ip" : "127.0.0.1", "client_max_body_size" : "128m", "worker_processes" : "2" } # grep worker /etc/nginx/nginx.conf worker_processes 2; worker_shutdown_timeout 10s; worker_rlimit_nofile 65536; worker_connections 4096; # Modify settings.json did not work because the reconfig must be run afterwards. so the solution to edit settings.json is working very well ;) 0 -
Thanks for sharing!!! 0
Please sign in to leave a comment.
Comments
7 comments