Scaling rules

更新时间:
复制 MD 格式

A scaling rule's type determines its function. You can use scaling rules to trigger scaling activities or intelligently adjust the boundary values of a scaling group. This topic describes the types of scaling rules, their limitations, and related operations.

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. Simple, step, and target tracking scaling rules trigger scaling activities, while predictive scaling rules intelligently set the boundary values for a scaling group. The following sections describe these rules, categorized by their purpose:

  • Scaling rules for triggering scaling activities

    Type

    Description

    simple scaling rule

    A simple scaling rule defines how a scaling group scales out or in. You can add or remove a specific number of instances, or adjust the number of instances to a specific value. Unlike target tracking and predictive scaling rules, a simple scaling rule can trigger either a scale-out activity or a scale-in activity, but not both simultaneously.

    Note

    If a simple scaling rule is triggered by an event-triggered task, the rule can be successfully executed only after the cooldown period ends.

    step scaling rule

    A step scaling rule is a staged scaling policy based on CloudMonitor alerts. It enhances simple scaling rules by letting you define step adjustments to precisely control scale-out and scale-in activities.

    target tracking scaling rule

    You select a CloudMonitor metric and a target value, and Auto Scaling automatically scales the group to keep the metric at or near that value. For more information, see Target tracking scaling rules.

    Note

    When you create a target tracking scaling rule, Auto Scaling automatically creates an associated event-triggered task for the scaling group. When the specified metric reaches your target value, this event-triggered task executes the associated target tracking scaling rule. To delete the event-triggered task, you must delete its associated target tracking scaling rule. Auto Scaling then automatically deletes the task.

  • Scaling rule for intelligently setting the boundary values of a scaling group

    • predictive scaling rule

      A predictive scaling rule analyzes at least 24 hours of a scaling group's historical monitoring data. It uses machine learning to forecast metric values for the next 48 hours, calculates the number of instances required each hour (the predicted value), and can automatically create scheduled tasks to intelligently adjust the boundary values of the scaling group. Prediction results are updated once a day, creating 48 new predictive tasks for the next 48 hours.

    • Benefits

      When you create a scaling group, you may not have enough information about your business workload to set the optimal boundary values. This can lead to a mismatch between your configuration and actual demand. A predictive scaling rule helps you avoid the following issues by intelligently setting the boundary values:

      • If the minimum number of instances is set too high, you may provision excess computing resources, which leads to unnecessary costs.

      • If the maximum number of instances is set too low, you may lack sufficient computing resources to handle load spikes, affecting service availability.

    • Notes

      When you create a predictive scaling rule, note the following:

      • A predictive scaling rule requires at least 24 hours of monitoring data to generate predictions.

      • If you modify the Target Value of a predictive scaling rule, the current predictive tasks are cleared and new predictive tasks are automatically generated within one hour.

      • A predictive scaling rule automatically adjusts a scaling group's boundary values—the maximum and minimum number of instances—and does not directly scale instances.

      • You can use a predictive scaling rule together with other scaling rules. When used with a target tracking scaling rule, we recommend that you set the same Metric Type and Target Value to prevent instance count fluctuations in the scaling group caused by metric differences.

      • We recommend that you first set the Predictive Mode to Predict Only and review the prediction results. If the results meet your expectations, change the Predictive Mode to Predict and Scale. For more information, see View the effects of a predictive scaling rule.

Limits

The following limits apply to scaling rules:

  • The number of scaling rules you can create per scaling group is limited. This quota depends on your Auto Scaling usage. Go to Quota Center to view your quota.

  • If a scaling rule would cause the number of In Service instances to exceed the maximum or fall below the minimum, Auto Scaling automatically adjusts the number of instances being scaled to ensure the total count remains within the defined limits. For example:

    • Your scaling group (for example, asg-bp19ik2u5w7esjcu****) has a maximum of 3 instances and a scaling rule named add3 that is configured to add 3 instances. If the scaling group has 2 In Service instances, executing the add3 rule adds only 1 instance.

    • Your scaling group (for example, asg-bp19ik2u5w7esjcu****) has a minimum of 2 instances and a scaling rule named reduce2 that is configured to remove 2 instances. If the scaling group has 3 In Service instances, executing the reduce2 rule removes only 1 instance.

  • If your account has an overdue payment, all scaling rules will fail to execute.

    Important

    To ensure Auto Scaling functions correctly, maintain a sufficient account balance.

Configure scaling rules

The following table lists documentation for configuring scaling rules.

Console

Actions

API

Configure scaling rules

Create a scaling rule

CreateScalingRule

Execute a scaling rule

N/A

Modify a scaling rule

ModifyScalingRule

Delete a scaling rule

DeleteScalingRule

View the effects of a predictive scaling rule

View the effects of a predictive scaling rule

N/A