nginx upstream problem

izghitu nginx-forum at nginx.us
Wed Apr 14 02:19:09 MSD 2010


Hi,

> >     include /etc/nginx/conf.d/*.conf;
> 
> Do you have only one file there?  Note that
> upstream{} blocks are 
> all defined in http section, and having two with
> identical names 
> are likely to cause confusion.

I have 2 upstreams, one for http and one for https, both have different names

> Does these servers (apache1, apache2, apache3)
> actually resolve 
> to distinct ip addresses?
Yes, they do resolve to distinct IP addresses. I used those names to hide the IPs.

> 

> nginx marks server as "down" after "max_fails"
> failures in 
> "fail_timeout" seconds, and re-enables it again
> after 
> "fail_timeout" seconds.
> 
> As it takes 60 seconds (default
> proxy_connect_timeout) to detect 
> that server is down, and you switch it off only
> for 5 seconds - 
> it's somewhat expected that nginx will try to use
> dead server most 
> of the time.
> 
> Also note that statuses of upstream servers are
> tracked 
> independantly by each worker (so with 32 workers
> you are likely to 
> see dead server used all the time by different
> workers).
> 
> You may tune nginx to behave a bit better by
> setting bigger 
> fail_timeout and/or smaller proxy_connect_timeout.
> 

Thanks for the info. I will try that and see how it goes.

Posted at Nginx Forum: http://forum.nginx.org/read.php?2,74663,74698#msg-74698




More information about the nginx mailing list