Configure scaling rules

更新时间:
复制 MD 格式

A scaling rule triggers scaling activities or manages scaling group capacity. Auto Scaling supports simple, step, target tracking, and predictive rules. Choose a type based on your business requirements.

Background

  • Auto Scaling supports four types of scaling rules: simple, step, target tracking, and predictive. Scaling rule overview.

    • ECS-type scaling groups support all four rule types.

    • ECI-type scaling groups support only simple and target tracking rules.

  • The number of scaling rules per scaling group is subject to a quota that varies by usage. Check your quota in Quota Center.

Create a scaling rule

  1. Log on to the Auto Scaling console.

  2. In the navigation pane on the left, click Scaling Groups.

  3. In the top navigation bar, select a region.

  4. Find the scaling group that you want to manage and, in the Actions column, click View Details.

  5. At the top of the page, click the Scaling Rules and Tasks tab.

  6. On the Scaling Rules tab, click Create Scaling Rule.

  7. Configure the parameters for the scaling rule.

    1. Enter a Rule Name.

    2. Select a Rule Type and configure the corresponding parameters.

      Parameters vary by rule type.

      Simple rule

      Supported by both ECS-type and ECI-type scaling groups.

      Parameter

      Description

      Operation

      Select an operation:

      • Adjust to N instances: Sets the instance count to N. Maximum: 1,000 instances per activity.

      • Add N instances: Adds N instances. Maximum: 1,000.

      • Add N%: Increases instance count by N%. Maximum: 1,000 instances per activity.

      • Remove N instances: Removes N instances. Maximum: 1,000.

      • Remove N%: Decreases instance count by N%. Maximum: 1,000 instances per activity.

        Note

        If you set Operation to Add N% or Remove N%, you must also specify Minimum Number of Instances to Adjust.

      Cooldown Time

      Optional. Unit: seconds. If unspecified, the scaling group's cooldown time applies. Cooldown time.

      Step rule

      Supported only by ECS-type scaling groups.

      Parameter

      Description

      Monitoring Type

      Monitoring type for the associated event-triggered task.

      • System Monitoring: metrics collected by CloudMonitor. Allows you to specify a system monitoring event-triggered task.

      • Custom Monitoring: custom metrics reported to CloudMonitor. Allows you to specify a custom monitoring event-triggered task.

      Run At

      Select an event-triggered task. Its trigger condition determines the step adjustments.

      Example: Average CPU utilization is greater than or equal to 80% for 3 consecutive periods.

      If no event-triggered tasks are available, create one. Click Create Event-Triggered Task next to the Run At parameter. Configure an event-triggered task.

      Note

      If you create an event-triggered task while creating a step scaling rule, the Resource Monitored of the event-triggered task is automatically set to the current scaling group, and the Triggered Rule is automatically set to the current step scaling rule.

      Operation

      Define step adjustments by breach size. Auto Scaling performs the corresponding action when the event-triggered task fires. At least one step adjustment is required.

      Example:

      • When 80 <= Average CPU utilization < 90, add 2 instances.

      • When 90 <= Average CPU utilization < +∞, add 3 instances.

      Breach size boundaries are constrained by the CloudMonitor metric. For example, if the metric is 'Average CPU utilization ≥ 80% for 3 consecutive periods', step adjustments must start at ≥ 80%.

      Step rules support the same operations as simple rules: Adjust to N instances, Add N instances, Remove N instances, Add N%, and Remove N%.

      Note

      If you set Operation to Add N% or Remove N%, you must also specify Minimum Number of Instances to Adjust.

      Instance Warmup Time

      Unit: seconds. Instances in warmup are added to the scaling group but excluded from CloudMonitor metrics and dynamic instance count calculations, preventing metric fluctuations.

      For example, with a 300-second warmup, two newly added instances are excluded from CPU utilization calculations for 300 seconds after creation.

      Target tracking rule

      Supported by both ECS-type and ECI-type scaling groups.

      Parameter

      Description

      Metric Type

      Select a CloudMonitor metric for the scaling group type.

      • If the scaling group is an ECS-type scaling group, you can select one of the following CloudMonitor metrics:

        • (ECS) Average CPU utilization, in %.

        • (ECS) Average inbound internal network traffic, in Kb/min.

        • (ECS) Average outbound internal network traffic, in Kb/min.

        • (ECS) Average inbound public network traffic, in Kb/min.

        • (ECS) Average outbound public network traffic, in Kb/min.

        • (ALB) QPS per Backend Server, in queries/second.

      • If the scaling group is an ECI-type scaling group, you can select one of the following CloudMonitor metrics:

        • CPU Utilization, in %.

        • Memory, in %.

        • (ALB) QPS per Backend Server, in queries/second.

      Note

      If you select (ALB) QPS per Backend Server as the CloudMonitor metric, you must also select an ALB server group.

      Target Value

      Target value for the CloudMonitor metric. A target tracking rule keeps the metric at or near this value.

      Instance Warmup Time

      Unit: seconds. Instances in warmup are added to the scaling group but excluded from CloudMonitor metrics and dynamic instance count calculations, preventing metric fluctuations.

      Threshold for Scale-out Alerts

      A scale-out event-triggered task is automatically created for this rule. Specifies how many consecutive threshold breaches trigger an alert.

      Threshold for Scale-in Alerts

      A scale-in event-triggered task is automatically created for this rule. Specifies how many consecutive threshold breaches trigger an alert.

      Disable Scale-in

      Determines which event-triggered tasks are automatically created:

      • Disabled: only a scale-out task is created. No instances are removed from the scaling group.

      • Enabled: two tasks are created, one for scale-out and one for scale-in.

      Predictive rule

      Supported only by ECS-type scaling groups. Only one predictive rule is allowed per scaling group.

      Parameter

      Description

      Reference Existing Target Tracking Scaling Rule

      Optional. Reuses the Metric Type and Target Value from an existing target tracking rule.

      Select a rule

      Optional. Available after enabling Reference Existing Target Tracking Scaling Rule. Select a target tracking rule to reuse its Metric Type and Target Value.

      Metric Type

      Select a CloudMonitor metric:

      • (ECS) Average CPU utilization, in %.

      • (ECS) Average inbound internal network traffic, in Kb/min.

      • (ECS) Average outbound internal network traffic, in Kb/min.

      Target Value

      Target value for the selected metric. The predictive rule calculates instance count based on multiple factors, including this value.

      Modifying this value clears existing prediction tasks; new tasks are created within one hour.

      Predictive Mode

      Select a prediction mode:

      • Forecast Only: generates prediction results but does not create prediction tasks.

      • Forecast and Scale: generates prediction results and creates prediction tasks.

      Start with Forecast Only, then switch to Forecast and Scale after validating the results. View prediction results on the scaling rule details page. View the prediction results of a predictive scaling rule.

      Preset Max Capacity

      Upper limit on instance count, used with Maximum Capacity Handling Method.

      Default: the current maximum instance count of the scaling group.

      Maximum Capacity Handling Method

      Action when predictions exceed the preset maximum:

      • Predicted Capacity Overwrites Preset Max Capacity: Uses the predicted value as the maximum when it exceeds the preset limit.

      • Preset Max Capacity Overwrites Predicted Capacity: Caps at the preset maximum even when the prediction exceeds it.

      • Predicted Capacity with Additional Ratio: used with Increase Ratio.

      The default value is Predicted Capacity Overwrites Preset Max Capacity.

      Increase Ratio

      Available only when Maximum Capacity Handling Method is set to Predicted Capacity with Additional Ratio. Increases the predicted value by this percentage. Example: predicted value 100 + 10% buffer = 110 maximum instances.

      Default: 0%. Maximum: 100%.

      Pre-launch Time

      Prediction tasks run on the hour by default. Set this value to start tasks ahead of schedule for resource preparation.

      Unit: minutes. Default: 0. Maximum: 60.

  8. Click OK.

    After creation, click the rule ID in the list to view details such as the rule type, identifier, execution condition, and operation.

Execute a scaling rule

Usage notes

  • Simple and step rules require manual execution. Target tracking and predictive rules execute automatically.

  • Before you execute a scaling rule, take note of the following:

    • Ensure your account has no overdue payments. Overdue payments cause all scaling rules to fail.

    • The scaling group to which the scaling rule belongs must be in the Enable state.

    • No scaling activities can be in progress. With desired capacity enabled, this applies only to non-parallel activities. Desired capacity.

Procedure

Select an execution method based on your business scenario:

  • Manual execution: Manually execute a rule to adjust instance count on demand. Manual scaling activities run immediately without waiting for the cooldown period to end. During cooldown, only CloudMonitor event-triggered scaling requests are rejected.

  • Automatic execution: Use scheduled tasks for predictable traffic patterns or event-triggered tasks for metric-based dynamic scaling.

Manual

  1. Log on to the Auto Scaling console.

  2. In the navigation pane on the left, click Scaling Groups.

  3. In the top navigation bar, select a region.

  4. Find the scaling group that you want to manage and, in the Actions column, click View Details.

  5. At the top of the page, click the Scaling Rules and Tasks tab.

  6. In the Scaling Rules list, find the scaling rule to execute and, in the Actions column, click Recurrently.

  7. Click OK.

Automatic

Method

Description

Execute a scaling rule by using a scheduled task

Specify a scaling rule when creating a scheduled task. Auto Scaling executes the rule at the scheduled time. Configure a scheduled task.

Execute a scaling rule by using an event-triggered task

Specify a scaling rule when creating an event-triggered task. Auto Scaling executes the rule when alert conditions are met. Configure an event-triggered task.

Modify or delete a scaling rule

Note
  • Modify rule properties instead of re-creating a rule.

  • Delete unused rules to free up your quota.

  1. Log on to the Auto Scaling console.

  2. In the navigation pane on the left, click Scaling Groups.

  3. In the top navigation bar, select a region.

  4. Find the scaling group that you want to manage and, in the Actions column, click View Details.

  5. At the top of the page, click the Scaling Rules and Tasks tab.

  6. In the Scaling Rules list, modify or delete a scaling rule.

    Modify rule

    1. Find the scaling rule that you want to modify and, in the Actions column, click Edit.

    2. Modify the parameters as needed, and then click OK.

      Parameter descriptions: Create a scaling rule.

      Note

      You cannot change the Rule Type of any scaling rule. For step scaling rules, you also cannot change the Run At parameter.

    Delete rule

    1. Find the scaling rule that you want to delete and, in the Actions column, click Delete.

    2. In the confirmation message that appears, click OK.