1

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?

Chawki
  • 189
  • 2
  • 12

1 Answers1

1

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.

Marcin
  • 215,873
  • 14
  • 235
  • 294
  • I already edit those settings and set them to the minimal, the LB detect host healthy just after few second and even that the traffic is not routed to healthy host just after some minutes. – Chawki Jun 07 '20 at 23:52
  • @Chawki Can you update your question with more information then. How do you perform the rolling updates? CodeDeploy, or rolling updates in AutoScaling Group? What is setting for health Check grace period for example, default is 300 seconds? – Marcin Jun 07 '20 at 23:55
  • i updated the post by adding pic of LB setting, I haven't an auto scaling group, all i have is a classic LB that load traffic between hosts on target group. – Chawki Jun 08 '20 at 00:05
  • @Chawki Thanks. But now I'm confused. In the question you wrote **classic load balancer**. The screenshot is from **application load balancer**. So can you clarify exactly what do you use? – Marcin Jun 08 '20 at 00:07
  • 1
    Sorry it's my fault, i want say **application load balancing.** – Chawki Jun 08 '20 at 00:10
  • @Chawki And now, how do you perform the rolling updates? Is it ASG rolling settings, code deploy, elastic beanstalk? – Marcin Jun 08 '20 at 00:13
  • 1
    Let us [continue this discussion in chat](https://chat.stackoverflow.com/rooms/215487/discussion-between-chawki-and-marcin). – Chawki Jun 08 '20 at 00:17