A
A
Andrey Kovalchuk2017-09-30 06:52:24
Nginx
Andrey Kovalchuk, 2017-09-30 06:52:24

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

2 answer(s)
M
Mikhail Grigoriev, 2017-10-03
@mrkovalchuk

Inside
NGINX : How We Designed for Performance & Scale

A
alejandro68, 2017-09-30
@alejandro68

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 question

Ask a Question

731 491 924 answers to any question