0

When we define health check grace period on ASG for 180 sec, will the ALB wait for that time (180 secs) for first health check to perform on new instances ? I know ASG will wait for that defined period but what about the ELB ? Because if it does it will mark it unhealthy soon depending on unhealthy threshold.

Note: Health check selected on ELB

nani
  • 43
  • 3

1 Answers1

1

No, the ALB has no knowledge of the ASG and will start doing healthchecks as soon as the instances are registered. As soon as the configured number of healthchecks pass, it will mark the instance healthy and start sending traffic to it.

The grace period set on the ASG is just to tell the ASG to ignore failing healthchecks for that amount of time.

Shahad
  • 771
  • 4
  • 6
  • How to set up ALB to wait until 180 sec to perform first health check – nani Nov 21 '20 at 21:59
  • @nani There is no such option. You can delay registration of instance with the target group only. – Marcin Nov 21 '20 at 23:17
  • @nani There is no need to tell the ALB to wait. If the healthcheck fails, the ALB will simply not serve traffic to the instance. That is good! It is only Auto Scaling that can Terminate an instance when health checks fail, hence the need to give it a 'grace period' before terminating unhealthy instances. – John Rotenstein Nov 21 '20 at 23:56
  • So it meant, ELB will do it health check with own configurations, regardless of what is mentioned in ASG. ELB will mark unhealthy after it reaches maximum unhealthy threshold. So what does delay register do ? What if my machine takes 5 min to get ready but once that is done I want to do health check every one minute and unhealthy threshold is 3? How do I achieve it. @John – nani Nov 22 '20 at 01:37
  • Configure the ELB health check as you describe. Then set the Auto Scaling `HealthCheckGracePeriod` to 5 minutes, which is "how long to wait before checking the health status of the instance". The ELB health checks will operate during the grace period, but will be ignored by Auto Scaling. Think of it like driving a car -- the traffic lights on the street will continue to operate even when you are not in your car. Then, after 5 minutes, you go to your car and start driving -- the traffic lights will then be relevant. – John Rotenstein Nov 22 '20 at 05:34
  • You can add a 180 second lifecycle hook on the ASG with default action as CONTINUE. This will delay new instances from being registered to the ELB until the hook finishes – Shahad Nov 22 '20 at 23:20
  • So during that HealthCheckGracePeriod, Even if ELB marks the instance to be unhealthy, ASG won't consider it and takes no action. Only after HealthCheckGracePeriod, ASG will take action ( terminate unhealthy instance and replace it ). Did I get it right @JohnRotenstein – nani Nov 22 '20 at 23:22