All Products
Search
Document Center

Auto Scaling:Configure scheduled tasks

Last Updated:Apr 16, 2026

Scheduled tasks let Auto Scaling add or remove instances at a fixed time — before a traffic spike hits or after it passes. Use them when you can predict load changes in advance, such as a promotional event on a specific date or a recurring daily traffic pattern.

For example, if your cluster sees a surge every evening at 19:00 and quiets down at 01:00, create two scheduled tasks: one to scale out at 19:00 and another to scale in at 01:00. Auto Scaling handles the rest automatically, so your cluster stays right-sized around the clock.

Prerequisites

Before you begin, ensure that you have:

  • A scaling group. See Create a scaling group

  • (Optional) A simple scaling rule, if you plan to use the Select an existing rule scaling method

Limitations

  • The number of scheduled tasks per Alibaba Cloud account per region is limited. To check your quota, go to Quota Center.

  • A scheduled task with a cron expression runs at most once every five minutes.

  • The Executed At time must be within 90 days of the date the task is created or last modified.

Go to the Scheduled Tasks page

All scheduled task operations are performed on the Scheduled Tasks page.

  1. Log on to the Auto Scaling console.

  2. In the left-side navigation pane, click Scaling Groups.

  3. In the top navigation bar, select a region.

  4. On the Scaling Groups page, click the name of the scaling group you want to manage.

  5. Choose Scaling Rules and Tasks > Scheduled Tasks.

image

Create a scheduled task

  1. On the Scheduled Tasks page, click Create Scheduled Task.

  2. In the Create Scheduled Task dialog box, configure the basic information.

    Parameter Description
    Task Name The task name. Must be 2–64 characters and can contain letters, digits, periods (.), underscores (_), and hyphens (-). Must start with a letter or digit.
    Description (Optional) A description of the task's purpose. Must be 2–200 characters.
  3. Configure the trigger time. Cron expressions Select Cron Expression in the Recurrence field to define a custom schedule. For example, 30 6 * * 2 runs the task every Tuesday at 06:30 UTC+0. A cron expression consists of five space-separated fields: [Minute] [Hour] [Day] [Month] [Day of week]. All times are in UTC+0 — convert your local time before configuring. For example, to run a task at 20:00 China Standard Time (UTC+8), subtract 8 hours and enter 0 12 * * ?.

    Parameter Description
    Executed At The time at which the task runs. If Recurrence is not set, the task runs once at this time. If Recurrence is set, the task runs at this time first, then repeats on the specified cycle. The time must be within 90 days of the task's creation or last modification date.
    Retry Interval (Seconds) (Optional) How long Auto Scaling retries the task if it fails. Valid values: 0–1800. Unit: seconds.
    Recurrence (Optional) The repeat cycle. Options: Not Set, By Day, By Week, By Month, Cron Expression.
    Expired At The end time of the repeat cycle. Available when Recurrence is set to By Day, By Week, By Month, or Cron Expression. The first execution must occur before this time.

    Fields

    Field Required Value range Special characters
    Minute Yes 0–59 , - / *
    Hour Yes 0–23 , - / *
    Day Yes 1–31 , - / * ? L W
    Month Yes 1–12 , - / *
    Day of week Yes 1–7 (Sunday = 7) , - * ? / L #

    Special characters

    Character Meaning Example
    * All valid values * in Month = every month
    , Enumerated values 5,20 in Minute = the 5th and 20th minutes
    - Range 5-20 in Minute = the 5th through 20th minutes
    / Increment 0/15 in Minute = every 15 minutes starting from minute 0
    ? Unspecified (Day and Day of week only) Use ? in the field you do not want to specify, to avoid conflicts
    L Last day of the period (Day and Day of week only). Do not specify a list or range when using L. L in Day = last day of the month; 6L in Day of week = last Saturday of the month
    W Nearest weekday to the specified date, within the same month. LW = last weekday of the month. 5W in Day: if the 5th is a Saturday, runs on Friday the 4th; if a Sunday, runs on Monday the 6th
    # Specific occurrence of a weekday in the month (Day of week only). Valid values: 1–5. 4#2 in Day of week = the 2nd Thursday of the month

    Examples (all times in UTC+0)

    Cron expression Schedule
    15 10 ? * * 10:15 every day
    15 9 * * * 09:15 every day
    0 12 * * ? 12:00 every day
    0 10,14,16 * * ? 10:00, 14:00, and 16:00 every day
    15 10 15 * ? 10:15 on the 15th of every month
    15 10 L * ? 10:15 on the last day of every month
    15 10 ? * 6L 10:15 on the last Saturday of every month
    15 10 ? * 6#3 10:15 on the 3rd Saturday of every month
  4. Configure the scaling method. Auto Scaling supports two scaling methods:

    Select Existing Scaling Rule

    Parameter Description
    Scaling Method Select Select an existing rule.
    Simple Scaling Rule Select an existing simple scaling rule. The rule defines whether to add or remove N instances, add or remove N% of instances, or set the total to N. See Configure scaling rules or CreateScalingRule.

    Configure Number of Instances in Scaling Group

    Parameter Description
    Scaling Method Select Configure the number of instances in a scaling group.
    Maximum Instances The upper limit of the scaling group capacity.
    Minimum Instances The lower limit of the scaling group capacity.
    Expected Instances The target size of the scaling group. Auto Scaling adjusts the actual instance count to match this value. Available only if the Expected Number of Instances feature is enabled for the scaling group.
  5. Click OK.

After the task is created, it is enabled by default.

Manage scheduled tasks

Disable a scheduled task

Disabling stops future executions without deleting the task. Only enabled tasks can be disabled.

On the Scheduled Tasks tab, find the task and click Disable in the Actions column.

Enable a scheduled task

Enabling resumes a disabled task. Only disabled tasks can be enabled.

On the Scheduled Tasks tab, find the task and click Enable in the Actions column.

Modify a scheduled task

On the Scheduled Tasks page, find the task and click Edit in the Actions column. Follow the on-screen instructions to update the task parameters.

For parameter details, see Create a scheduled task.

Delete a scheduled task

On the Scheduled Tasks page, find the task and click Delete in the Actions column. Follow the on-screen instructions to confirm the deletion.

API reference