Nginx Windows High Traffic issues

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


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 ?

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 

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

More information about the nginx mailing list