Forum: NGINX upstream: grant recovery time to backend server

2974d09ac2541e892966b762aad84943?d=identicon&s=25 revirii (Guest)
on 2012-10-16 12:21
(Received via mailing list)
Hello,

i have a load balancing setup running with nginx in front and 2 tomcats
as
backend:

upstream backend  {
  ip_hash;
  server 192.168.1.100;
  server 192.168.1.101;
}

Runs fine so far, but from time to time one of the tomcats crashes and
needs
to be restarted. As soon as nginx notices that the tomcat is coming up,
nginx starts to forward requests to the starting-up tomcat. But it would
be
better that the tomcat starts up completly before nginx starts sending
requests to it.

Is there any possibility to grant a recovery time to a backend server
before
the backend receives requests? I.e. something like "nginx: hey, i
noticed
that the formerly crashed backend server is coming up, but i'll wait
300s
before sending requests to it"?


thx in advance
revirii

Posted at Nginx Forum:
http://forum.nginx.org/read.php?2,231854,231854#msg-231854
A8108a0961c6087c43cda32c8616dcba?d=identicon&s=25 Maxim Dounin (Guest)
on 2012-10-16 12:51
(Received via mailing list)
Hello!

On Tue, Oct 16, 2012 at 06:21:00AM -0400, revirii wrote:

>
> Runs fine so far, but from time to time one of the tomcats crashes and needs
> to be restarted. As soon as nginx notices that the tomcat is coming up,
> nginx starts to forward requests to the starting-up tomcat. But it would be
> better that the tomcat starts up completly before nginx starts sending
> requests to it.
>
> Is there any possibility to grant a recovery time to a backend server before
> the backend receives requests? I.e. something like "nginx: hey, i noticed
> that the formerly crashed backend server is coming up, but i'll wait 300s
> before sending requests to it"?

Don't open listen sockets on a backend server unless you think
it's started and ready to handle requests?

--
Maxim Dounin
http://nginx.com/support.html
Please log in before posting. Registration is free and takes only a minute.
Existing account

NEW: Do you have a Google/GoogleMail, Yahoo or Facebook account? No registration required!
Log in with Google account | Log in with Yahoo account | Log in with Facebook account
No account? Register here.