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
Even with the following nginx builds for high traffic production enviorments http://nginx-win.ecsds.eu/ It still seems like the worker_rlimit_nofile is to small by default on nginx start up so unless you know to add the command into your nginx config with some insanely high value to it your site will seem slow as hell.
I read on stackoverflow the following.
events {
worker_connections 19000; # It's the key to high performance - have a lot of connections available
}
worker_rlimit_nofile 20000; # Each connection needs a filehandle (or 2 if you are proxying)
But in my config i set the following just to test
events {
worker_connections 16384;
multi_accept on;
}
worker_rlimit_nofile 9990000000;
And everything still works fine can anyone explain so i can understand why this value is so small in the first place ?