2 Answers
- Newest
- Most votes
- Most comments
0
Hi there. Can you provide a measurement (in seconds) of how long it takes instances to appear as healthy? How does this compare to the health check interval? I understand you don't want to modify the health check.
0
Everything you're describing sounds generally like expected behavior, and should usually be fine
ALB:
- ALB will start doing healthchecks as soon as the instances are registered
- If the application isn't running, the instance will fail the ALB HealthChecks, and once the
UnhealthyThresholdCount
has been reached, the ALB will mark the instance asUnhealthy
- ALB will usually not send traffic to the Unhealthy (or initializing) instances. If all instances are unhealthy at the same time, then ALB will fail open and sends traffic to them; but as long as you have at least 1 healthy instance, no traffic will go to these new unhealthy ones
ASG
- In your AutoScaling Group (ASG), the instance will be 'healthy' by default when its launched
- ASG will ignore failing ELB healthchecks until the
HealthCheckGracePeriod
is done (5 minutes in your case) - If the instance is still unhealthy at the end of the Grace Period, the next time ASG does a healthcheck, it will likely mark the instance unhealthy and replace it (sounds like your application isn't unhealthy this long though?)
Improvements
- You can delay the ASG registering the instance to the ALB by adding a Lifecycle Hook(LCH) to the ASG. Instances are only registered to the ELB after the LCH ends.
- As a best practice, you should set the default action as
ABANDON
, and then have the bootstrapping send a complete-lifecycle-action API call with theCONTINUE
result as soon as your scripts have verified the application is up and running correctly. This way, only confirmed working instances are registered to the ALB
Relevant content
- asked 9 months ago
- asked a year ago
- asked 6 months ago
- AWS OFFICIALUpdated 8 months ago
- AWS OFFICIALUpdated 4 months ago
- AWS OFFICIALUpdated 8 months ago
- AWS OFFICIALUpdated 5 months ago