worker_rlimit_nofile is for total of all worker processes or single worker process?

fengx nginx-forum at
Mon May 15 15:18:15 UTC 2017

I read through the source codes and find the limit should be applied to each
worker process. Right ?

static void
ngx_worker_process_init(ngx_cycle_t *cycle, ngx_int_t worker)
    // .....

    if (ccf->rlimit_nofile != NGX_CONF_UNSET) {
        rlmt.rlim_cur = (rlim_t) ccf->rlimit_nofile;
        rlmt.rlim_max = (rlim_t) ccf->rlimit_nofile;

        if (setrlimit(RLIMIT_NOFILE, &rlmt) == -1) {
            ngx_log_error(NGX_LOG_ALERT, cycle->log, ngx_errno,
                          "setrlimit(RLIMIT_NOFILE, %i) failed",

Posted at Nginx Forum:,274218,274227#msg-274227

More information about the nginx mailing list