Event-triggered tasks can be used based on Auto Scaling and CloudMonitor to dynamically manage scaling groups. Similar to a scheduled task, an event-triggered task triggers a specific scaling rule to execute scaling activities. This allows you to adjust the number of instances in a scaling group.
A scheduled task is preconfigured to execute the specified scaling rule at the specified time in the future. You can create scheduled tasks in advance based on predictable business changes. However, when unpredictable business traffic occurs, scheduled tasks cannot meet these requirements. In this case, you can use event-triggered tasks to trigger scaling rules in a more flexible manner. Auto Scaling can add instances to a scaling group during peak hours, and release instances during off-peak hours to reduce costs.
Event-triggered tasks collect statistical values in real time by monitoring specific metrics. When statistical values meet the alarm conditions, alarms are triggered to execute specified scaling rules. You can use event-triggered tasks to adjust the number of instances in a scaling group based on business changes. This can ensure that the values of monitoring metrics are within your expected range.
- System monitoring tasks: the standard event-triggered tasks. By default, system monitoring metrics are available for you to choose from.
- Custom monitoring tasks: the custom event-triggered tasks, in which you can integrate your customized monitoring metrics to ensure service availability.
- If the Expected Instances feature is enabled for a scaling group, Auto Scaling cannot execute other scaling activities for the scaling group when a non-parallel scaling activity is being executed. For more information, see Expected Instances.
- During the cooldown period, Auto Scaling rejects the scaling rule that is triggered by an event-triggered task. Typically, it takes a few minutes for Auto Scaling to add ECS instances to a scaling group, start the instances, deploy businesses, and collect monitoring metrics. We recommend that you specify an appropriate cooldown period based on your business requirements. This can ensure that the scaling rule is not repeatedly triggered when the monitoring metrics of newly added instances are not collected.
- The reference period of an event-triggered task is set to one minute by default. The monitoring metrics are collected every one minute.