NGNIX uses epoll notification to know if there is any data on the socket to read.
Let assume: There are two requests to the server. nginx is notificated about this two requests and starts to:
receive the first request
parse ist headers
check the boudary (body size)
send the first request to upstream server
etc.
nginx is singe-threaded and can do only one operation at the same time.
But what happens with the second request?
Does nginx receive the second request during parsing the first one?
Or it begins to handle the second request after getting the first done?
Or something else that I don't understand.
If 1. is correct than I don't understand how it is possible within a single thread.
If 2. is correct than how can nginx be so fast? because nginx handles all incoming requests sequentially. At any given time only ONE request handling is possible.
Please help me to understand. Thanks