All Products
Search
Document Center

Auto Scaling:Overview

Last Updated:Apr 01, 2026

Event-triggered tasks watch your scaling group's metrics in real time and automatically execute scaling rules when alert thresholds are crossed—adding instances during traffic spikes and removing them when demand drops.

How it works

Event-triggered tasks integrate Auto Scaling with CloudMonitor. When a monitored metric crosses an alert threshold, Auto Scaling executes the scaling rule attached to that task—scaling out to add capacity or scaling in to release it. Metrics are collected continuously, so the task responds to real workload changes rather than a fixed schedule.

Use event-triggered tasks when you can't predict when traffic will change. If your business follows a predictable pattern and you know exactly when peak hours occur, scheduled tasks are simpler. For unpredictable spikes, event-triggered tasks monitor in real time and react automatically.

Task types

Create event-triggered tasks from the Auto Scaling console:

  • System monitoring tasks: use built-in CloudMonitor metrics as alert conditions.

  • Custom monitoring tasks: use metrics from your own monitoring system. This type provides a standard integration path between your custom monitoring pipeline and Auto Scaling, which improves the availability of event-triggered tasks.

Limitations

Cooldown period

Auto Scaling needs a few minutes to add Elastic Compute Service (ECS) instances or elastic container instances, start them, deploy services, and collect their metric data. During this startup window, new instance metrics are unavailable, which means a task could trigger repeatedly before the scaling group has stabilized. The cooldown period prevents this by blocking further scaling rule execution until the group is ready.

Event-triggered tasks cannot execute scaling rules during the cooldown period. Set the cooldown period based on your typical instance startup time to avoid repeated triggers while new instances are initializing.

Parallel scaling activities

If you have not configured an expected number of instances for your scaling group, Auto Scaling cannot execute other scaling activities while a non-parallel scaling activity is in progress. For details, see Expected number of instances.

One-minute statistical period

Each event-triggered task has a default one-minute statistical period. Within that minute, no additional scaling rules are triggered—even if the metric continues to exceed the threshold.

Cron expression

When creating an event-triggered task, set Effective Period to Cron Expression to restrict when the task is active.

A cron expression is a five-field string in the X X X X X format, where fields represent seconds, minutes, hours, days, and months (in that order). Each field accepts a specific value or a special character.

Important

Cron expressions use UTC+0. Convert your local time before configuring the expression. For example, to activate a task between 01:00 and 02:59 China Standard Time (UTC+8), subtract 8 hours and set the expression to * * 17-18 * *.

If an alert fires outside the effective period, the task enters the Alert state but does not execute the scaling rule.

Field reference

FieldRequiredValue rangeSpecial characters
SecondYes0–59, - / *
MinuteYes0–59, - / *
HourYes0–23, - / *
DayYes1–31, - / * L W
MonthYes1–12, - / *

Special characters

CharacterDescriptionExample
*All valid valuesIn Month: every month
,Enumerated valuesIn Minute: 5,20 means the 5th and 20th minutes
-RangeIn Minute: 5-20 triggers once per minute from the 5th to the 20th minute
/IncrementIn Minute: 0/15 means every 15 minutes starting at 0; 3/20 means every 20 minutes starting at 3
LLast day (Day field only)L means the last day of the month. Do not combine L with a list or range.
WNearest weekday5W resolves to the nearest weekday to the 5th: if the 5th is Saturday, fires on Friday the 4th; if Sunday, fires on Monday the 6th; if a weekday, fires on the 5th.

Sample expressions (UTC+0)

ExpressionActive period
* * * * *Always active
* 0-30 1-2 * *01:00–01:30 and 02:00–02:30 every day
* * 0,2 * *00:00–00:59 and 02:00–02:59 every day
* * 1 1/2 *01:00–01:59 every other day starting on the 1st of each month (1st, 3rd, ...)
* * 1 L *01:00–01:59 on the last day of each month
* * 1 5W *01:00–01:59 on the weekday nearest to the 5th of each month

Manage event-triggered tasks

OperationUser guideAPI reference
CreateManage event-triggered tasksCreateAlarm
ViewManage event-triggered tasksDescribeAlarms
ModifyManage event-triggered tasksModifyAlarm
DeleteManage event-triggered tasksDeleteAlarm
DisableManage event-triggered tasksDisableAlarm
EnableManage event-triggered tasksEnableAlarm