1 Answer
- Newest
- Most votes
- Most comments
0
If you need to reboot an EC2, remove it from the target group before you reboot it so that the connections are drained and you don’t have the issue waiting for the health checks to time out.
After the reboot add it back in.
You can do this automatically such as when patching using SSM lifecycle.
Relevant content
- AWS OFFICIALUpdated 24 days ago
- AWS OFFICIALUpdated 3 months ago
- AWS OFFICIALUpdated 9 months ago
Thanks, I will check into removing the EC2 from the target group for reboots. Are there any options for unplanned outages such as if the webserver stops responding? I see the minimum HealthCheckIntervalSeconds is 5 and UnhealthyThresholdCount is 2, so I believe that means there will be at most 10 seconds of downtime where end users will get http 502 errors trying to access my website. Is there any way to have a faster failover since I already have a 2nd (or 3rd or more) webserver in the load balancer?
I suppose I could write my own script to check the webserver health on a faster interval and remove it from the target group myself, but curious if there was a better way.
Thanks again for your help.