Answer the question
In order to leave comments, you need to log in
How does nginx work?
Guys, tell me. Do I understand how nginx works correctly?
Nginx creates a pool of server sockets that listen on a specific port (:80). When a request arrives on the port, it is sent to one of the sockets, which changes its state. The server, at this time, polls sockets using (epoll, etc.), finds those that have changed their state and transfers the task to one of the workers.
The worker either processes the request itself (for issuing statics) or passes it to an additional web server that generates dynamic content. Further, this content is returned to nginx, compressed and stored in the buffer until the moment it is issued back (when the socket is ready to send data back to the user)
All the while, nginx is polling other sockets for state updates. and repeats the above procedures.
Is this interpretation correct?
Answer the question
In order to leave comments, you need to log in
Not really.
nginx supports different models of epoll, kqueue, etc.
You have described only one option.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question