# Upstream: grant recovery time to backend server

**URL:** <https://www.ruby-forum.com/t/upstream-grant-recovery-time-to-backend-server/223741>\
**Category:** NGINX\
**Created:** [October 16, 2012, 12:21pm UTC](https://www.ruby-forum.com/t/upstream-grant-recovery-time-to-backend-server/223741 "2012-10-16T12:21:58Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![aris](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/258eb7/32.png) [@aris](https://www.ruby-forum.com/u/aris)\
**Post date:** [October 16, 2012, 12:21pm UTC](https://www.ruby-forum.com/t/upstream-grant-recovery-time-to-backend-server/223741/1 "2012-10-16T12:21:58Z")

</div>

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:

> **[upstream: grant recovery time to backend server](https://forum.nginx.org/read.php?2,231854,231854#msg-231854)**
>
> 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 tomc

---

<div class="post-metadata">

**Author:** ![revirii](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/d2c977/32.png) [@revirii](https://www.ruby-forum.com/u/revirii)\
**Post date:** [October 16, 2012, 12:51pm UTC](https://www.ruby-forum.com/t/upstream-grant-recovery-time-to-backend-server/223741/2 "2012-10-16T12:51:12Z")

</div>

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 D.

> **[F5 NGINX: Built for cloud-native apps. Ready for AI traffic.](https://www.f5.com/products/nginx)**
>
> Deliver modern applications with NGINX. Explore high-performance load balancing, API gateways, and web server solutions trusted by top global enterprises.
