3 ms·
Just to add - Nginx normally spawns several worker processes that all process connections to the same port.
by krab 5y ago
Just to add - Nginx normally spawns several worker processes that all process connections to the same port.
- nullify88 5y agoCorrect but to clarify, only the master process binds to the ports. The master process creates socketpairs to the workers for interprocess communication. The workers accept connections over the shared socket. https://www.nginx.com/blog/socket-sharding-nginx-release-1-9-1/ https://www.nginx.com/blog/socket-sharding-nginx-release-1-9... Page also has an example of how SO_REUSEPORT effects flow.
- krab 5y agoOh, thanks! I didn't know that. I supposed it worked by inheriting the listening socket but I didn't check.