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:
Nginx start a spawns itself several times depending on
configuration and/or server processors count.Altough it uses I/O completion ports, each worker only creates
one thread to handle requests.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?
Answer
The scalability of nginx on Windows is limited, so it's not a recommended platform for a production 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.
No comments:
Post a Comment