Nginx uses epoll to communicate clients and it's very efficient, but how Nginx communicate with upstreams, I google and get a answer from quora http://www.quora.com/How-can-nginx-handle-concurrent-requests-with-a-single-worker-process, but the answer doesn't answer the question, I check the source code of Nginx,it has a implementation of thread pool ,the file: http://trac.nginx.org/nginx/browser/nginx/src/core/ngx_thread_pool.c I don't good at C, so I don't know how nignx use the thread pool.
but if nignx work process use single thread to deal with all requests, when nignx wait for data from upsteam, it should block the thread, so the thread can't service other requests, but in fact, Nginx does a good job with upstreams, how does it be implemented?