NGINX+Windows how to serve a static html file (100kb) to 10k concurrent users

Amina asked:

This is the NGINX config file:

            gzip                  on;
            gzip_disable    "MSIE [1-6].";
            gzip_vary          on;
            gzip_proxied    any;
            open_file_cache max=200000 inactive=20s; 
            open_file_cache_valid 30s; 
            open_file_cache_min_uses 2;
            open_file_cache_errors on;
            access_log off;
            sendfile on;
            tcp_nopush on;
            tcp_nodelay on; 
            keepalive_timeout 0;
            reset_timedout_connection on;
            client_body_timeout 10;

            ...

            events {
               worker_connections  4000;
            }
            worker_processes  4;

The problem is that many users cannot get the file (cannot connect/timeout)
The file is a push message, to an desktop app.

So, I have two questions:
1. Anyone knows the maximum “worker_connections” that ningx supports on Windows 2008 R2?
2. Do I need to change something in Windows Registery, I cannot find what to change, and the exact numbers.

I don’t want to be off-topic, but just to tell the background. Today I am serving the file using Amazon S3, and it cost almost $1000 per month. I have a dedicated server, so I want to save the $$$, and serve the file myself. If you know about other cheaper alternative to S3, you can comment.

Thank you.

My answer:


On Windows, nginx has significant limitations:

  • You can only have 1024 worker_connections. Any higher number will be ignored. And even if you start more than one, only one worker will actually do any work.
  • nginx can only use select(); there is no high-performance event handler.

These are the reasons why using nginx on Windows for high performance, high scalability environments is a bad idea.

Switch to nginx on a non-Windows operating system as soon as possible.


View the full question and answer on Server Fault.

Creative Commons License
This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License.