Nginx Windows High Traffic issues

Maxim Dounin mdounin at mdounin.ru
Thu Jun 26 18:44:16 UTC 2014


Hello!

On Thu, Jun 26, 2014 at 09:41:15AM -0400, c0nw0nk wrote:

> So i spent a while on this one and turns out the problem is a little
> function in nginx's core called "worker_rlimit_nofile".
> 
> 
> But for me on windows (i don't know if it does it for linux users too.)
> grinds my site down to a halt unless you increase its value.
> 
> Why does it do this ?
> http://nginx.org/en/docs/ngx_core_module.html#worker_rlimit_nofile

On unix, worker_rlimit_nofile does exactly what's documented: it 
calls setrlimit(RLIMIT_NOFILE) within worker process.  This allows 
to change OS-imposed limit without restarting nginx.  And there is 
no default in nginx itself - the default is set by OS and it's 
configuration.

Note well that the words "without restarting" is actually the 
reason why this directive exists at all.  If a restart isn't a big 
deal, then OS limit can be changed by native means ("ulimit -n" 
and friends).

In official nginx on Windows, worker_rlimit_nofile does nothing.  
Not sure if there is an equivalent limit on Windows at all.

-- 
Maxim Dounin
http://nginx.org/



More information about the nginx mailing list