Vertical scaling adjusts the instance type (vCPUs and memory) of specified ECS instances on a schedule or based on real-time metrics. You can upgrade the instance type to ensure sufficient computing power when demand increases, or downgrade it to reduce costs when demand decreases.
Background information
Vertical scaling adjusts the instance type (vCPUs and memory) for pay-as-you-go instances. It applies to both regular and fluctuating workloads. For more information about the benefits, billing, and limits of vertical scaling, see Vertical scaling overview.
Create a vertical scaling task
-
Go to the Vertical Scaling page.
Log on to the Auto Scaling console.
In the navigation pane on the left, click Vertical Scaling.
In the top navigation bar, select a region.
-
In the upper-left corner, click Create Vertical Scaling Task.
-
On the Create Vertical Scaling Task page, configure the parameters for the task.
The following table describes the task parameters.
Parameter
Description
Task Type
The scaling direction:
-
Upgrade: Upgrades the instance type to increase computing power.
-
Downgrade: Downgrades the instance type to reduce computing power.
Select Instance
The instance to which the task applies.
Select Instance Type
The target instance types. If you specify multiple types, the task scales the instance to each type in the specified order.
ImportantVertical scaling tasks can only adjust instance types within the same instance family.
-
Scale-up instance types: Specify up to 10 instance types in ascending order of computing power. The vCPU and memory of a subsequent instance type must be greater than those of the previous instance type.
For example, the current instance type is ecs.g6.large. You specify ecs.g6.3xlarge, ecs.g6.4xlarge, and ecs.g6.6xlarge in this order. If two consecutive scale-up tasks run successfully, the instance type changes to ecs.g6.4xlarge.
-
Scale-down instance types: Specify up to 5 instance types in descending order of computing power. The vCPU and memory of a subsequent instance type must be less than those of the previous instance type.
For example, the current instance type is ecs.g6.6xlarge. You specify ecs.g6.4xlarge, ecs.g6.3xlarge, and ecs.g6.large in this order. If three consecutive scale-down tasks run successfully, the instance type changes to ecs.g6.large.
Trigger Type
The method to trigger the task. Valid values:
-
Scheduled Trigger: You must specify the frequency and time for the task to run.
-
One-time execution: Select Execute Now, or select Executed Once at the Specified Time and then configure an execution time.
-
Recurring execution: Select Executed Periodically and then configure the recurrence frequency, time zone, and end time.
Click Quick Selection to configure the recurrence frequency in the UI, or specify a cron expression. For more information about cron expressions, see Cron expressions.
ImportantVertical scaling restarts your pay-as-you-go instance, which causes service interruptions. We recommend that you schedule the task during off-peak hours.
-
-
Threshold Trigger: You must specify a threshold-based rule and a trigger silence period.
-
Rule: Define a threshold condition for a CloudMonitor metric. A threshold-based rule includes the metric name, aggregation period, number of consecutive periods, statistical method, comparison operator, and threshold.
For example, to trigger a vertical scaling task when the average DiskIOPSWrite metric exceeds 70 count for three consecutive 5-minute periods, set Metric to DiskIOPSWrite, Aggregation Period to 5 Minutes, Consecutive Periods to 3, Method to Average, Comparison Operator to >, and Threshold to 70 (Unit: count).
-
Trigger Silence Period: If monitoring data continuously exceeds the alert threshold, only one task runs during the silence period.
ImportantConfigure threshold conditions with caution. If the number of consecutive periods is too small or the silence period is too short, your ECS instance may restart frequently, which can affect your services.
-
Permissions
Grant permissions to the RAM role that CloudOps Orchestration Service (OOS) uses.
-
If this is your first time using vertical scaling, create a RAM role for OOS and grant it permissions to manage ECS and Auto Scaling resources. For more information, see Create a RAM role for a trusted Alibaba Cloud service and Grant permissions to a RAM role.
NoteWe recommend that you attach the AliyunECSFullAccess and AliyunESSFullAccess policies.
-
If you have used vertical scaling before, select an existing RAM role, such as OOSServiceRole.
Advanced
Optional. Add a description and tags to identify and manage the task.
-
-
Click Create Vertical Scaling Task.
After the task is created, you can view its details on the Vertical Scaling page.
View a vertical scaling task
After a vertical scaling task is created, it runs at a specified time or when a threshold condition is met. The task stops the target instance, adjusts the instance type, and then starts the instance. You can view execution details, including the execution time, result, and logs.
-
Go to the Vertical Scaling page.
-
On the Vertical Scaling page, find the task by its trigger type and task type (scale-up or scale-down).
-
In the Actions column, click Details.
You can view the Basic Information, Task Information, and Execution progress of the task. You can also view past executions on the Historical executions tab, scheduled times on the To be Executed tab, and all logs for the current execution on the Execution Logs tab.
NoteIn the Execution Progress section, click View Execution Flowchart to view the detailed steps of the task execution.
-
On the Historical executions tab, view the execution result and logs of each past execution.
-
On the To be Executed tab, view the scheduled execution times.
-
Clone a vertical scaling task
To quickly create a vertical scaling task, clone an existing one and modify its configuration.
-
Go to the Vertical Scaling page.
-
Find the vertical scaling task that you want to clone and click Clone in the Actions column.
-
On the Clone Vertical Scaling page, modify the task's configuration.
For more information about the parameters, see the parameter descriptions in the "Create a vertical scaling task" section of this topic.
-
Click Create Vertical Scaling Task.
Cancel or delete a vertical scaling task
If a vertical scaling task is no longer needed, you can cancel a pending task or delete a canceled or completed one.
-
Go to the Vertical Scaling page.
-
Perform one of the following operations based on your business requirements:
-
Find a pending task and click Cancel in the Actions column.
-
Find a canceled or completed task and click Delete in the Actions column.
-
-
In the message that appears, click OK.