Welcome! Log In Create A New Profile

Advanced

[RFC] Core: worker_processes <= NGX_MAX_PROCESSES

Peter Stadler
May 12, 2020 06:06AM
Would it be advisable to limit the number of worker_processes to
NGX_MAX_PROCESSES at least when we have `worker_processes auto;` in the
config?

A corresponding patch could be:

diff a/src/core/nginx.c b/src/core/nginx.c
--- a/src/core/nginx.c
+++ b/src/core/nginx.c
@@ -1478,7 +1478,7 @@ ngx_set_worker_processes(ngx_conf_t *cf,
ngx_command_t *cmd, void *conf)
     value = cf->args->elts;

     if (ngx_strcmp(value[1].data, "auto") == 0) {
-        ccf->worker_processes = ngx_ncpu;
+        ccf->worker_processes = ngx_min(ngx_ncpu, NGX_MAX_PROCESSES);
         return NGX_CONF_OK;
     }



_______________________________________________
nginx-devel mailing list
nginx-devel@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx-devel
Subject Author Views Posted

[RFC] Core: worker_processes <= NGX_MAX_PROCESSES

Peter Stadler 62 May 12, 2020 06:06AM

Re: [RFC] Core: worker_processes <= NGX_MAX_PROCESSES

Maxim Dounin 17 May 12, 2020 09:44AM

Re: [RFC] Core: worker_processes <= NGX_MAX_PROCESSES

Peter Stadler 28 May 12, 2020 01:00PM



Sorry, you do not have permission to post/reply in this forum.

Online Users

Guests: 86
Record Number of Users: 6 on February 13, 2018
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready