- Newest
- Most votes
- Most comments
To best answer your question, I'd suggest you to go through this AWS Documentation, specially Scaling performance considerations section in this doc.
Yes, you can configure both periods and if you don't set a default instance warmup, the instance refresh feature uses the health check grace period as the default warm-up time. Most applications will benefit from having one default instance warm-up time that applies to all features rather than different warm-up times for different features. For example, if you don't set a default instance warmup, the instance refresh feature uses the health check grace period as the default warm-up time. If you have any target tracking and step scaling policies, they use the value set for the default cooldown as the default warm-up time. If you have any predictive scaling policies, they have no default warm-up time.
And for cool down, lets assume: Health Check Grace Period = 200 and Default Cooldown = 100:
Let's say I've launched instance and CPU utilization goes above 50%(defined threshold), instance will wait 200 seconds to become healthy. If CPU utilization comes under 50% and it becomes healthy after 200 seconds, it will continue to run, otherwise it will be terminated. If the CPU utilization is above 50% at 100th second, the auto scaling group will start a new instance. Which means that, with this configuration, new instance would be launched at 100th second by ASG if CPU utilization was above 50% at 100th second.
Lifecycle hook is a mechanism for custom solution that are aware of events in the Auto Scaling instance lifecycle, and then perform a custom action on instances when the corresponding lifecycle event occurs. It comes in to the play at the time of scale in and scale out but it is scoped for performing custom actions at the time of instance launching and instance terminating. Lifecycle hook won't have influence on Scaling Warmup Period and Health Check Grace Period. Instead will start performing those custom actions when scale in/scale out will be happening.
Additional Reference:
-
Differences between step scaling policies and simple scaling policies section at Step and simple scaling policies for Amazon EC2 Auto Scaling
Hope you find this information helpful.
Comment here if you have additional questions, happy to help.
Abhishek
Relevant content
- asked 2 years ago
- asked a year ago
- Accepted Answerasked 10 months ago
- AWS OFFICIALUpdated 4 months ago
- AWS OFFICIALUpdated 2 years ago
- AWS OFFICIALUpdated 10 months ago
Sorry, I missed to cover lifecycle hooks part in my answer, just added that in the answer, please check and comment here if you have additional questions.
Adding a bit of clarification on the Hook part: The instance will move to InService once the launching lifecycle hook finishes. Cooldown/warmup/grace period all start once the instance moves to InService
Thank you Shahad_C for adding to it. @HHEECC, do you have additional questions.