how nginx handle connection with backend web server?

meto nginx-forum at
Tue Aug 11 02:22:31 MSD 2009

Xuepeng Li Wrote:
> my quest is:
> if every request needs to get dynamic conetent(not
> static file, image, css
> ...),  nginx has to proxy the request to backend
> apache server. in this
> circumstance, if all apache server process have
> been occupied, then
> following requests have to wait until a apache
> server is released.  right ?
> if we have 200 apache process  and all backend
> apache server are occupied,
> the other 29800 requests have to wait untile a
> apache process is freed or
> socket connection timeout?
> "The main nginx advantage is that it gets quickly
> whole response from
> backend
> and frees it to handle other requests."
> Sorry,  I don't understand how enginx could "get
> quickly whole response",
> the response time is decided by apache
> server(business logic),  why enginx
> could do it more quickly than direct connetion ?
> 3ks
> ---Xuepeng

I think you need maxconn feature provided by module (or path as i recall) for nginx, but personally i'd prefer other approach:
nginx -> haproxy -> apache
haproxy is the best thing to throttle request and queue them in the proper way, also you can use other grate features of HAproxy, with minimal overhead. 


Posted at Nginx Forum:,4823,4855#msg-4855

More information about the nginx mailing list