The purpose of a scaling rule varies based on its type. You can use a scaling rule to trigger a scaling activity or adjust the boundary values for a scaling group. The boundary values include the minimum number of instances that must be contained in a scaling group and the maximum number of instances that can be contained in a scaling group. This topic describes the types and limits of scaling rules. This topic also describes the operations that you can perform on scaling rules.
Scaling rule types
Auto Scaling supports the following types of scaling rules: simple scaling rules, step scaling rules, target tracking scaling rules, and predictive scaling rules. You can use simple scaling rules, step scaling rules, and target tracking scaling rules to trigger scaling activities. You can use predictive scaling rules to automatically adjust the boundary values for scaling groups. The following items describe the scaling rules based on their purposes.
Scaling rules that are used to trigger scaling activities
Type
Description
Simple scaling rule
You can specify the number of instances that you want to add to or remove from a scaling group in a simple scaling rule. You can also specify the number of instances that you want to include in a scaling group in a simple scaling rule. Compared with target tracking scaling rules and predictive scaling rules, simple scaling rules cannot trigger scale-outs and scale-ins at the same time.
NoteIf you specify a simple scaling rule in an event-triggered task and you want to execute the task to trigger a scaling activity, you must wait for the cooldown period of the scaling group to end before you can execute the task.
Step scaling rule
A step scaling rule is a multi-step scaling policy based on CloudMonitor event-triggerred tasks. A step scaling rule includes a set of steps that allow you to manage instance scaling in a fine-grained manner. Each step of a step scaling rule can be considered a simple scaling rule.
Target tracking scaling rule
When you create a target tracking scaling rule, you must select a CloudMonitor metric and specify a target value. Auto Scaling automatically calculates the required number of instances and scales instances based on the calculated number to keep the metric value close to the target value. For more information, see Target tracking scaling rule.
NoteAfter you create a target tracking scaling rule, Auto Scaling automatically creates an event-triggered task and then associates the task with the target tracking scaling rule. When the metric of the scaling group reaches the target value, the event-triggered task is triggered to execute the associated target tracking scaling rule. If you no longer require the event-triggered task, delete the associated target tracking scaling rule first. After you delete the associated rule, Auto Scaling automatically deletes the event-triggered task.
Scaling rules that are used to automatically configure the boundary values
Predictive scaling rule
You can create a predictive scaling rule to automatically adjust the boundary values for your scaling group. After you create a predictive scaling rule, Auto Scaling analyzes the monitoring data of the past 24 or more hours in your scaling group and uses machine learning technology to predict metric values for the upcoming 48 hours. Then, Auto Scaling calculates the number of instances that are required each hour and creates a scheduled task. The calculated number of instances is a predicted number. The scheduled task is triggered at the specified point in time to automatically adjust the boundary values for your scaling group based on the predicted number. Auto Scaling updates its predicted metric values once each day and creates 48 predication tasks for the next 48 hours.
Benefits
If your business has no specific pattern or you cannot accurately estimate the business workloads, the boundary values that were configured when you created your scaling group may not meet the actual business requirements. In this case, you can create predictive scaling rules to prevent the following issues:
If the minimum number of instances in the scaling group is greater than the required number of instances, Auto Scaling purchases an excessive amount of computing resources. As a result, resources are wasted and costs increase.
If the maximum number of instances in the scaling group is less than the required number of instances, the computing resources are insufficient to meet your business requirements. This affects service availability.
Usage notes
Before you create a predictive scaling rule, take note of the following usage notes:
A predictive scaling rule requires at least 24 hours of historical metric data to generate predictions.
If you change the value of the Target Value parameter for a predictive scaling rule, the current prediction task is cleared and a new prediction task is automatically generated within 1 hour.
A predictive scaling rule changes only the minimum and maximum numbers of instances for a scaling group. A predictive scaling rule does not scale the instances in the scaling group.
A predictive scaling rule can be used together with other scaling rules. When you use a predictive scaling rule together with a target tracking scaling rule, we recommend that you specify the same metric and target value for both rules. Otherwise, the number of instances in the scaling group may frequently change due to the difference in the metrics.
We recommend that you initially set the Predictive Mode parameter to Predict Only. If the predictions meet your expectations, change Predictive Mode from Predict Only to Predict and Scale. For more information, see View the prediction effect of a predictive scaling rule.
Limits
The following limits apply to scaling rules:
You can create only a limited number of scaling rules for a scaling group. To view the quota of scaling rules, visit Quota Center.
If the number of instances that are in the In Service state after you execute a scaling rule is greater than the maximum number of instances or less than the minimum number of instances, Auto Scaling automatically adjusts the number of instances to ensure that the number of instances is within the allowed range. Examples:
You have a scaling group named asg-bp19ik2u5w7esjcu**** that can contain up to three instances. You also have a scaling rule named add3 that adds three instances during scale-outs. The scaling group contains two instances that are in the In Service state. If you execute the add3 scaling rule, only one instance is added to the scaling group.
You have a scaling group named asg-bp19ik2u5w7esjcu**** that must contain at least two instances. You also have a scaling rule named reduce2 that removes two instances during scale-ins. The scaling group contains three instances that are in the In Service state. If you execute the reduce2 scaling rule, only one instance is removed from the scaling group.
If you have overdue payments within your Alibaba Cloud account, you cannot execute scaling rules.
ImportantTo use Auto Scaling, make sure that you have sufficient balance within your Alibaba Cloud account.
Manage scaling rules
The following table describes the operations that you can perform on scaling rules and also provides the related links.
User guide | Operation | API reference |
Create a scaling rule | ||
Execute a scaling rule | N/A | |
Modify a scaling rule | ||
Delete a scaling rule | ||
View the effect of a predictive scaling rule | N/A |