From my limited understanding of nginx, I know that nginx separates itself from Apache using a single thread that processes all requests instead of Apache, which throw threads into the problem. Theoretically, with a bunch of small queries, it's faster. But what about long queries.
Suppose a user loads a large file or some long PHP script runs there, which slows down due to something depending on (disk I / O, database) is slow. With Apache, everything has its own stream, so while PHP is waiting for a response from the database, another request can come in and be processed at the same time. With nginx, however, would there be something like this to block the thread and therefore the entire server? I know that you can have multiple nginx processes, but creating more processes to upload files is just like trying to recreate Apache.
I know that something is missing here, since nginx handles such situations, but what? How does nginx do this with its threading model?
And before you say that, this is not a duplicate of this question , since it only talks about incoming connections
Thelq source share