How does nginx worker process share the 'liste

2019-04-14 16:22发布

This http://aosabook.org/en/nginx.html says that "worker processes accept new requests from a shared ""listen" socket and execute a highly efficient run-loop inside each

I looked at hte code but did not understand how the socket is shared. Is it the case that the master process creates a listen queue, binds and then forks. In that case, how does the OS decide which worker process to hand over the incoming connection to? Is it round robin or random? I am assuming that different OS may have different policies

标签: nginx
1条回答
该账号已被封号
2楼-- · 2019-04-14 16:45

In that case, how does the OS decide which worker process to hand over the incoming connection to?

The question sounds exactly like "how does the OS decide which process will get to run".

http://en.wikipedia.org/wiki/Scheduling_%28computing%29#Operating_system_process_scheduler_implementations

查看更多
登录 后发表回答