If you have predictable load changes, you can configure scheduled tasks to provision sufficient computing resources before traffic peaks and release idle resources afterward. This helps you meet business demands while controlling costs.
Design a scaling plan
Before you create a scheduled task, design a scaling plan.
Plan 1: One-time scaling
-
Scenario
This plan is for scenarios with a predictable, one-time change in resource demand, allowing for automated scaling.
-
Implementation
Create a scheduled task for a specific point in time. Configure its trigger time and scaling action. For more information, see Create a scheduled task.
-
Example
For example, if your platform runs a sales promotion on Double 11, you can schedule a task to scale out your computing resources to meet the anticipated increase in traffic and ensure service stability.
Plan 2: Recurring scaling
-
Scenario
This plan is ideal for applications with predictable, recurring traffic patterns.
-
Implementation
Create one scheduled task to scale out before an expected increase in usage and another to scale in when usage is expected to decrease. For more information, see Create a scheduled task.
-
Example
For example, if your application traffic increases at 7:00 PM and decreases at 1:00 AM every day, you can create two scheduled tasks to handle these changes:
-
To handle increased traffic: Create a scheduled scale-out task to run at 7:00 PM every day. This task increases the number of replicas to improve the cluster's capacity.
-
To handle decreased traffic: Create a scheduled scale-in task to run at 1:00 AM every day. This task reduces the number of replicas to improve resource utilization and lower costs.
-
Access the scheduled tasks page
You can manage all scheduled tasks for a scaling group on its Scheduled Tasks page. Follow these steps to access the page.
Create a scheduled task
After you design a scaling plan, follow these steps to create a scheduled task to implement it.
The number of scheduled tasks that you can create per account is limited. The quota in a specific region depends on your Auto Scaling usage. To view your quota, go to Quota Center.
-
On the Scheduled Tasks tab, click Create Scheduled Task. In the Create Scheduled Task dialog box, configure the following parameters.
-
Configure the Basic Information for the task.
Parameter
Description
Task Name
Enter a name for the scheduled task.
The name must be 2 to 64 characters long and 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 long. Use the description to record the task's purpose for future reference.
-
Configure the Execution Time for the task.
Parameter
Description
Executed At
The time when the scheduled task is triggered.
-
If no recurrence is set, the task runs only once at the specified date and time.
-
If a recurrence is set, this time serves as the execution time for the recurring task.
ImportantThe execution time must be within 90 days of the task's creation or modification date. Otherwise, the task will not run.
Retry Interval (Seconds)
Optional. The period in which Auto Scaling retries a failed task. Valid values: 0 to 1800 (30 minutes).
Recurrence
Optional. The recurring schedule for the task. You can select Not Set, By Day, By Week, By Month, or Cron Expression.
Expired At
This parameter appears if you set Recurrence to By Day, By Week, By Month, or Cron Expression. Specify when the recurring task ends. The end time must be later than the first execution time.
-
-
Configure the Action to Execute for the scheduled task.
NoteDifferences between the two scaling methods:
-
Select Existing Scaling Rule: Allows you to add or remove N instances, add or remove N% of instances, or adjust the total number of instances to N.
-
Set Number of Instances in Scaling Group: Allows you to modify the Maximum/Minimum Instances settings. If an expected number of instances is enabled for the scaling group, you can also set the expected number of instances.
Scaling rule
Parameter
Description
Scaling Method
Set this to Select an existing rule. You must then select an existing simple scaling rule from your scaling group.
Simple Scaling Rule
This parameter appears when Scaling Method is set to Select Existing Scaling Rule. Select an existing simple scaling rule. For more information, see Manage scaling rules or CreateScalingRule.
Instance count
Parameter
Description
Scaling Method
Set this to Configure the number of instances in a scaling group. You must then enter a value for Maximum Instances, Minimum Instances, or Expected Number of Instances.
Maximum Instances
The upper bound for the number of instances in the scaling group.
Minimum Number of Instances
The lower bound for the number of instances in the scaling group.
Expected Number of Instances
The scaling group initiates scaling activities to ensure that the number of running instances matches this value.
-
-
-
After you confirm the configuration, click OK.
Disable a scheduled task
Scheduled tasks are enabled by default after creation. You can disable a task if it is temporarily not needed. You can disable a task only if it is in the Enable state.
Procedure
On the Scheduled Tasks page, find the task to disable and click Disable in the Actions column.
Enable a scheduled task
To resume a disabled task, you can enable it. You can enable a task only if it is in the Disable state.
Procedure
On the Scheduled Tasks page, find the task to enable and click Enable in the Actions column.
Modify a scheduled task
If a scheduled task no longer meets your requirements, you can modify it.
Procedure
On the Scheduled Tasks page, find the task to modify and click Modify in the Actions column. For parameter descriptions, see Create a scheduled task.
Delete a scheduled task
If you no longer need a scheduled task, you can delete it.
Procedure
On the Scheduled Tasks page, find the task to delete and click Delete in the Actions column.