Reputation: 874
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?
Upvotes: 0
Views: 410
Reputation: 43505
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.
Upvotes: 1