About the way nginx deals with listening sockets
It uses mutex to make worker process take turns to accept new connections on each listening socket.
Why not assign specific listening sockets to each worker process ,thus avoiding the overhead of the mutex thing开发者_如何学C?
Most likely to get a more even distribution of requests over each worker. If you have one port handling more requests than others then the worker handling that socket will have to handle more requests.
精彩评论