What is the Cooldown Period?
The AS cooldown period is a configurable setting for a scaling group. By setting the cooldown period, you can ensure that AS does not launch or terminate other instances before the previous scaling activity takes effect. After a scaling group is dynamically scaled using a simple scaling policy, AS waits for the cooldown period to complete before continuing the scaling activity.
When you manually scale out a scaling group, the default is to not wait for the cooldown period, but you can set a cooldown period to override the default setting. Note that if an instance is detected to be unhealthy, AS replaces the unhealthy instance immediately without waiting for the cooldown period to complete.
Why Do We Need a Cooldown Period?
After a machine is added to the scaling group, it takes some time to reduce the load. If there is no cooldown period, the system continues to scale-out before the load drops. After the newly added machine takes over the business, if the load is too low, it scales-in.
These instances use configuration scripts to install and configure the software before the instances are put into use, so it takes about two to three minutes for the instances to be launched and put into use. (The actual time depends on many factors, such as the size of the instance and whether there are launch scripts to complete.)
Scenario Example
A spike in traffic occurs, which triggers the alarm policy. When it does, AS enables an instance to help with the increase in demand. However, there's a problem: the instance takes a couple of minutes to enable, and it will also take some time for the enabled instance to receive requests from CLB. During that time, the monitor alarm could continue to be triggered, causing AS to enable another instance each time the alarm is triggered.
However, if a cooldown period is set, after an instance is launched, AS suspends all scaling activities caused by simple scaling policies or manual scaling until the specified amount of time has passed (the default value is 60 seconds). This gives newly launched instances time to start handling application traffic.
After the cooldown period, all paused scaling operations will resume. If the alarm is triggered again, AS will launch another instance, and the cooldown period will be reactivated. However, if the added instance is sufficient to reduce the CPU utilization to a normal level, then the group will maintain its current size.
Setting Cooldown Period
The default cooldown period is 60 seconds.
If you need to modify it, follow the steps below:
- Open the scaling group details page.
- Click Alarm Triggered Policy, select the alarm scaling policy to be set, select Modify, and specify the cooldown period (which can be set from 0 to 999,999 seconds) below the edit box.