Talk me through the upstream process

Igor Sysoev is at rambler-co.ru
Tue Jun 24 14:59:14 MSD 2008


On Tue, Jun 24, 2008 at 11:44:18AM +0100, Alan Williamson wrote:

> So far I am loving nginx; its doing what lighhtpd was doing but no where 
> near consuming the CPU.  Result.
> 
> I would like to understand how it manages the pool of backend machines. 
>  Say for example I have:
> 
> upstream backends {
>  server 10.0.0.150:80 weight=2;
>  server 10.0.0.153:80;
>  server 10.0.0.154:80;
> }
> 
> Now, assume one of them goes off line, the others one will pick up the 
> load, but when will nginx decide to put it back into the pool of 
> available workers?   Does every new connection coming in, trigger an 
> attempt to the offline servers?
> 
> Maybe there is some docs i am missing that explains this already, but 
> any pointers would be appreciated.

If some backend goes off, then nginx passes failed request to another one.
It will not pass new request until fail_timeout (by default 30s) will expire.
You may change fail_timeout:

    server  10.0.0.153 fail_timeout=2m;



-- 
Igor Sysoev
http://sysoev.ru/en/





More information about the nginx mailing list