Drubio
Drubio

Reputation: 1367

How do 'Health Check Grace Period' and 'Default Cooldown' in AWS autoscaling work?

I've been playing with the configuration of my autoscaling groups but I do not totally get how this two work.

As Amazon says Health Check Grace Period refers to:

The length of time that Auto Scaling waits before checking an instance's health status. The grace period begins when an instance comes into service.

While Default Cooldown refers to:

The number of seconds after a scaling activity completes before another can begin. This is also called the cooldown period. Learn more about cooldown periods.

So imagine I have a rule that scales out when CPU consumption is above 50% and that Health Check Grace Period = 300 and Default Cooldown = 100. If I launch an instance at second 0, how long will it be until AWS checks the CPU consumption of the scaling group? And, how long will it be until a new instance is launched? Would the time be 400 seconds till launch and other 100 till the CPU check of the group again? Thanks.

Upvotes: 6

Views: 4238

Answers (1)

jogold
jogold

Reputation: 7407

Health Check Grace Period and Default Cooldown are different concepts. Health Check Grace Period applies to a single instance while Default Cooldown applies to the auto scaling group.

If an instance is launched at second 0 because the CPU is above 50%, this new instance will get a grace period of 300 seconds to become healthy. If healthy after 300 seconds it will continue to run, otherwise it will be terminated.

If the CPU is still above 50% at second 100, the auto scaling group will start a new instance (the last scaling action took place 100 seconds ago = cooldown period). Hence, the answer to your question is 100 seconds until a new instance is launched.

Please also note that by default, Amazon EC2 Auto Scaling does not honor the cooldown period during manual scaling activities (= setting desired capacity) and that if an instance becomes unhealthy, the Auto Scaling group does not wait for the cooldown period to complete before replacing the unhealthy instance.

Upvotes: 10

Related Questions