Talk me through the upstream process

Igor Sysoev is at
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 weight=2;
>  server;
>  server;
> }
> 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 fail_timeout=2m;

Igor Sysoev

More information about the nginx mailing list