I have a autoscaling setup with monitoring and all is well. The process for code deployment is now well in hand and basically does this.
- Create a new launch_config which defines the git commit to pull
- Update the autoscale group with the new launch config.
- Scale up the min-size of the servers to ~2x what we have.
- Wait for them all to come online
- Scale down and the old ones get knocked off.
The problem that I am seeing is that while we are "waiting for them to come online" they are reporting "healthy" and "in service" before they are "ready" for service as they are updating the packages and pulling the relevant source code. This time varies greatly from 2 minutes to > 15 minutes per EC2 instance.
What I'm looking for is a way do you set the "in service/healtny" flag manually, or a better strategy for dealing with this lag.
I will note that when the instance fires off Nginx is started automatically. Is that what determines whether the instance is healthy? There is so little documentation (that I can find) on this process of boot to ready - any help would be appreciated.
This is behind an ELB if that helps. Health checks are enabled "/". I wonder if it's as simple as that..