The main advantage of Nginx is cited as it not needing to spawn separate threads for each request it receives.
Now, if we were to run a python based web application using FastCGI, and this web application has blocking calls, would this create a bottleneck?
Since there is only a limited number of workers running(1 per processor?), wont a blocking call by a python script make it cooperative multiprocessing?
Nginx talks to a fastcgi process over a socket connection.
If the fastcgi process blocks, that means that it won't be sending data over the socket.
This won't block nginx as such, because it keeps processing events (data from other connections). It uses non-blocking techniques like select, poll or equivalent OS-dependent functions (with a timeout) to query sockets without blocking.
But it will stall whatever client is waiting for the fastcgi output.
Nginx + FastCGI with blocking calls