Chawki
Chawki

Reputation: 347

Is there a way to let LB route traffic to host once it become healthy?

I have two ec2 instances behind an application load balancer, I'm trying to update application on host by host (Rolling update). To do that i follow those steps : 1. stop nginx sevice 2. update application 3. start nginx service by stopping nginx service LB mark host as unhealthy and route traffic to the other host. and do the same thing on the second host.

the problem is that after starting nginx service and LB mark host as a healthy it don't route traffic to this host only after some times (4 min on average). like that i have a critical downtime.

LB Settings :

enter image description here

Is there a way to let LB route traffic to host once it become healthy?

Upvotes: 1

Views: 143

Answers (1)

Marcin
Marcin

Reputation: 238867

Update: Based on the chat discussion, the cause of the issue for now is unknown. Further troubleshooting will resume soon though.


One way would be to customize your health check. You haven't included your ELB health check settings, thus I will assume that you use the default ones.

By default, the classic load balancer users the following settings:

enter image description here

Notice that Healthy Threshold and HealthCheck Interval are 10 and 30 seconds respectively. This basically evaluates to 5 minutes (5 min = 300 seconds = 10 x 30). Thus your instances require 5 minutes to be considered healthy by the balancer.

Adjusting these settings should reduce the time you observe.

Upvotes: 1

Related Questions