Configure scheduled tasks
If changes in workload are predictable, you can configure scheduled tasks to prepare sufficient computing resources before peak traffic arrives, or promptly release idle computing resources after the peak, meeting business needs while controlling costs.
Design a scheduled scaling plan
Decide when the task must run and what it must change before you create it.
Plan 1: scale once at a specific point in time
When to use — You expect a sudden increase or decrease in resource demand at a specific point in the future, and you want the scaling action to run automatically at that time.
How to implement — Create a scheduled task for that point in time. Set the trigger time, and specify the scaling action that the task performs after it is triggered. For the full procedure, see Create a scheduled task in this topic.
Example — If your platform runs a promotional campaign on Double 11, schedule a scale-out of your compute resources on that day to meet the actual resource demand and keep services running stably.
Plan 2: scale on a recurring schedule
When to use — Your workload fluctuates in a regular pattern. That is, the resource usage of your scaling group rises and falls at predictable times.
How to implement — At times when resource utilization in the business cluster increases, trigger scaling out through scheduled tasks. Conversely, when resource utilization decreases, trigger scaling in through scheduled tasks. For the full procedure, see Create a scheduled task in this topic.
Example — Traffic to your workload increases at 7:00 PM and decreases at 1:00 AM every day. To address changes in business access demand, you can set the following two scheduled tasks.
Configure a scheduled scale-out task for 7:00 PM that increases the number of instances in the scaling group to add capacity.
Configure a scheduled scale-in task for 1:00 AM that decreases the number of instances to improve resource utilization and reduce unnecessary costs.
Go to the scheduled task list
You manage all scheduled tasks of a scaling group from the Scheduled Tasks list. To open the list, perform the following steps.
Log on to the Auto Scaling console.
In the left-side navigation pane, click Scaling Groups.
In the top navigation bar, select a region.
On the Scaling Groups page, find the scaling group that you want to manage and click the scaling group name to go to the scaling group details page.
Click the Scaling Rules and Tasks tab and find the Scheduled Tasks list.
Create a scheduled task
After you design your scheduled scaling plan, create a scheduled task that implements it. Go to the Scheduled Tasks list of the scaling group, and then perform the following steps.
The number of scheduled tasks that can be created under one account is limited. The number of scheduled tasks in a single region depends on the usage of Auto Scaling. Please go to the Quota Center to view the quota value.
Click Create Scheduled Task. In the Create Scheduled Task dialog box that appears, configure the parameters as prompted and as described in the following tables.
Configure the Basic Information of the scheduled task.
Parameter
Description
Task Name
Enter a name for the scheduled task. The name must be 2 to 64 characters in length and must start with a letter, a digit, or a Chinese character. It can contain periods (.), underscores (_), and hyphens (-).
Description
Optional. Enter a description for the scheduled task. The description must be 2 to 200 characters in length. Use the description to record information such as the purpose and role of the scheduled task for later reference.
Configure the Execution Time of the scheduled task.
Parameter
Description
Executed At
Enter the time when the scheduled task is triggered.
If no recurrence is configured, the task runs once at the specified date and time.
If a recurrence is configured, the point in time specified by this parameter is used by default as the execution time of the recurring task.
ImportantDo not specify a time later than 90 days from the day on which the task is created or modified. Otherwise, the scheduled task cannot take effect.
Retry Interval (Seconds)
Optional. The length of the retry window, in seconds. Valid values: 0 to 1800 (30 minutes). If the scaling action is not triggered at the execution time, Auto Scaling keeps trying to run the scheduled task until the retry window expires.
Recurrence
Optional. Select the period at which the scheduled task runs repeatedly. Valid values: Not Set, By Day, By Week, By Month, or a cron expression.
Expired At
This parameter appears only when the recurrence is set to By Day, By Week, By Month, or a cron expression. Enter the end time of the recurrence for the scheduled task. The end time of the recurrence must be later than the first execution time of the task.
Configure the Action to Execute for the scheduled task, that is, the scaling method that the task uses. Choose the scaling method based on the result that you want:
Adjust capacity relative to the current capacity, or to a value defined in a rule — Select Select an existing rule. The task runs a simple scaling rule that you configured to Add/Remove N instances, Add/Remove N% of instances, or Adjust to N instances.
Change the capacity boundaries or the target capacity of the scaling group — Select Configure the number of instances in a scaling group. The task modifies the Maximum/Minimum Instances of the scaling group. If the expected number of instances is enabled for the scaling group, the task can also set the Expected Number of Instances.
Select an existing scaling rule (simple rule)
Parameter
Description
Scaling Method
Select an existing rule: After you select this scaling method, also select an existing scaling rule (simple rule) in the scaling group.
Simple Scaling Rule
This parameter appears only when the scaling method is Select an existing rule. Select a scaling rule (simple rule) that you created in the scaling group. For more information, see Configure scaling rules.
Set the number of instances in the scaling group (directly modify the instance count of the scaling group)
Parameter
Description
Scaling Method
Configure the number of instances in a scaling group: After you select this scaling method, also enter the maximum number of instances, the minimum number of instances, or the expected number of instances.
Maximum Instances
The upper limit for the number of instances in the scaling group.
Minimum Number of Instances
The lower limit for the number of instances in the scaling group.
Expected Number of Instances
The scaling group adjusts the actual number of instances through scaling activities so that the actual number of instances in the scaling group equals the expected number of instances.
After you confirm the configuration, click OK to complete the creation of the scheduled task.
Manage existing scheduled tasks
Disable, re-enable, modify, and delete scheduled tasks from the Scheduled Tasks list of the scaling group. Find the scheduled task that you want to manage, click the corresponding button in the Actions column, and then complete the operation as prompted.
Operation | Button | Description |
Disable a scheduled task | Disable | A scheduled task is enabled after you create it. Disable the task if you do not need it to trigger a scaling activity for the time being. Available only for a task in the Enabled state. |
Re-enable a scheduled task | Enable | Enable a disabled task again to continue using it at the specified time. Available only for a task in the Disabled state. |
Modify a scheduled task | Modify | Change the configuration of a scheduled task that no longer meets your requirements. For descriptions of the parameters, see Create a scheduled task in this topic. |
Delete a scheduled task | Delete | Delete a scheduled task that is no longer in use. |