as
  1. Help Center
  2. AS Management
  3. Scaling Actions
  4. Dynamically Expanding Resources

Dynamically Expanding Resources

Before using AS to perform scaling actions, you must specify how to perform the scaling actions to dynamically expand resources. For a web application that allows users to purchase train tickets, when the average CPU usage of the instances that run the application goes up to 90%, instances need to be added to ensure that services run properly. When the average CPU usage goes down to 40%, instances need to be reduced to prevent the waste of resources.

If your demands change frequently, you can also configure alarm policies for dynamically expanding or reducing resources. When the conditions for triggering an AS policy are met, AS automatically changes the expected number of instances for triggering a scaling action to scale up or down resources.

Procedure

  1. Log in to the management console.
  2. Under Computing, click Auto Scaling.
  3. Locate the row containing the target AS group and click View AS Policy in the Operation column.
  4. Click Add on the displayed AS Policies page.
  5. Configure required parameters. For details, see Table 1.
    Table 1 Parameters to be configured

    Parameter

    Description

    Example Value

    Policy Name

    Specifies the name of an AS policy.

    as-policy-p6g5

    Policy Type

    Select Alarm.

    Alarm

    Alarm

    You can use an existing alarm rule or create a new one.

    To create an alarm rule, configure the following parameters:
    • Alarm Name

      Specifies the name of the new alarm rule, for example, as-alarm-7o1u.

    • Trigger Condition

      Specifies a monitoring metric and condition for triggering a scaling action. For example, when the CPU usage becomes higher than 70%, AS automatically triggers a scaling action.

    • Monitoring Interval

      Specifies the interval (such as five minutes) at which the alarm status is updated based on the alarm rule.

    • Consecutive Occurrences

      Specifies the number of sampling points when an alarm is triggered. If Occurrences is set to n, the sampling points of the alarm rule are the sampling points in n consecutive sampling periods. Only if all the sampling points meet the threshold configured for the alarm rule will the alarm rule status be refreshed as the Alarm status.

    N/A

    Scaling Action

    Specifies an action and the number/percentage of instances.

    The following scaling action options are available:
    • Add

      Adds instances to an AS group when the scaling action is performed.

    • Reduce

      Removes instances from an AS group when the scaling action is performed.

    • Set to

      Sets the expected number of instances in an AS group to a specified value.

    • Add 1 instance
    • Add 10% instances
      The number of instances to be added is 10% of the current number of instances in the AS group. If the product of the current number of instances and the percentage is not an integer, AS automatically rounds the value up or down:
      • Rounds down the value that is greater than 1. For example, value 12.7 is rounded down to 12.
      • Rounds up the value that is greater than 0 and less than 1 to 1. For example, value 0.67 is rounded up to 1.

      For example, there are 10 instances in an AS group, and the scaling action is Add 15% instances. When the AS policy is triggered, AS calculates the number of instances to be added is 1.5 and rounds 1.5 down to 1. After the scaling action ends, there are 11 instances in the AS group.

    Cooldown Period

    Specifies a period of time after each scaling action is complete. During the cooldown period, scaling actions triggered by alarms will be denied. Scheduled and periodic scaling actions are not restricted.

    NOTE:
    • If a scaling action is triggered by an AS policy, the cooling duration is that which is configured for that AS policy.
    • If a scaling action is triggered by manually changing the expected number of instances or by other actions, the cooldown period is that which is configured for the AS group.

    300s

  6. Click OK.

    The newly added AS policy is displayed on the AS Policy tab. In addition, the AS policy is in Enabled state by default.