Nginx+PHP scalability on Windows

Mauro H. Leggieri asked:

I’m trying to understand Nginx+PHP scalability running Windows with, lets say, 100 requests doing a medium-term operations.

Analyzing source code I saw:

  1. Nginx start a spawns itself several times depending on
    configuration and/or server processors count.

  2. Altough it uses I/O completion ports, each worker only creates
    one thread to handle requests.

  3. When a PHP request is done, Nginx communicates with PHP using FastCGI

At this point, although NGinx can continue scaling, I cannot see in standard PHP fastcgi sapi code that scales using multiple threads/processes and completion ports.

For unix/linux, PHP-FPM come to solve the problem because it forks child processes to complete tasks altough not sure about the performance.

But back into Windows, still in PHP-FPM, I don’t see specific code to mantain the whole webserver performance high.

Is there an alternative for Windows? Is something wrong in my research?

My answer:


The scalability of nginx on Windows is limited, so it’s not a recommended platform for a production web site.

From the nginx web site:

Version of nginx for Windows uses the native Win32 API (not the Cygwin emulation layer). Only the select() connection processing method is currently used, so high performance and scalability should not be expected.

Although several workers can be started, only one of them actually does any work.

A worker can handle no more than 1024 simultaneous connections.


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.