All Products
Search
Document Center

Enterprise Distributed Application Service:Perform auto scaling on applications in ECS clusters

更新時間:Aug 16, 2023

Auto scaling is an important O&M capability that is used to manage distributed applications. The auto scaling feature provided by Enterprise Distributed Application Service (EDAS) detects the status of each instance for an application and implements dynamic scaling based on the status. This ensures service quality and improves application availability.

Overview of auto scaling

Applications such as the Internet and gaming applications are prone to sudden traffic surges during promotional activities. Moreover, imbalance between service level agreements (SLAs) and resource costs may cause system issues, such as slow responses and breakdowns. EDAS inherits the traffic flood management technology that Alibaba Group uses to cope with Double 11 to provide auto scaling within seconds. This ensures SLAs and reduces the usage of instances to save costs. Auto scaling is widely used in industries such as the Internet, gaming, and social media platforms.

Auto scaling is applicable to applications that are created in ECS clusters. In a single-instance environment, auto scaling ensures that one instance keeps running in the environment. In an environment where the traffic fluctuates, you can configure a load rule to specify the number of running instances for auto scaling. Then, EDAS adds or removes instances based on the configured rule.

Auto scaling determines whether to enable and perform a scale-out or a scale-in based on the following metrics of an application instance:

  • CPU: the CPU utilization. The value is a percentage.

  • RT: the response time to a request. The unit is milliseconds.

  • Load: the load on the application instance. The value is a positive integer.

Configure an auto scaling rule

Auto scaling includes auto scale-out and scale-in activities. You can configure a different rule for each activity. The following example shows how to configure a scale-out rule.

Note
  • When you configure both scale-in and scale-out rules, make sure that the metric values of the scale-in rules are not greater than the metric values of the scale-out rules. Otherwise, an error message appears when you click Save.

  • The instances that are created based on elastic resources are first released during a scale-in.

  1. Log on to the EDAS console.

  2. In the left-side navigation pane, choose Application Management > Applications. In the top navigation bar, select the region where the application you want to manage resides. In the upper part of the Applications page, select the microservices namespace to which the application belongs from the Microservices Namespace drop-down list. Then, click the name of the application.

  3. In the left-side navigation pane of the application details page, click Auto Scaling.

  4. In the upper-right corner of the Scale-Out Rule section, turn on the switch to enable the scale-out rule.

  5. Configure the following parameters of the scale-out rule. In the lower-left corner of the Auto Scaling page, click Save.

    1. Configure Trigger Metrics to specify the thresholds for the CPU, RT, and Load metrics. When one or more metric values exceed a threshold, a scale-out is triggered.

    2. From the Trigger Conditions drop-down list, select one of the following values:

      • Any One of the Metrics: A scale-out is triggered when the value of one of the configured metrics exceeds the specified threshold.

      • All Metrics: A scale-out is triggered only when the values of all configured metrics exceed the specified thresholds.

    3. Specify Last for More Than. This parameter specifies the duration during which the metric value repeatedly exceeds the threshold. Unit: minutes. Within the duration, if the average value of a metric repeatedly exceeds the specified threshold every minute, a scale-out is triggered. You can configure the duration based on the sensitivity of the cluster service capabilities.

    4. Specify Application Source. Valid values:

      • Existing Resources: EDAS selects a specific number of idle ECS instances in the cluster to which your application belongs for the scale-out.

        Note

        If the number of idle ECS instances in the cluster cannot meet the scale-out requirement, EDAS performs the scale-out based on the number of existing instances.

      • Elastic Resources: EDAS purchases instances based on a set of existing instance specifications or an instance launch template. Then, EDAS imports the purchased instances to the cluster to which your application belongs for the scale-out.

        Parameter

        Description

        Creation Method

        • Purchase Based on Existing Instance Specifications: EDAS purchases instances based on one of the existing specifications of the instances in the cluster.

        • Purchase Based on Instance Launch Template: EDAS purchases instances based on the instance launch template that you created in the ECS console.

        Template Host or Launch Template

        The value of Creation Method determines whether Template Host or Launch Template appears. Select a set of existing instance specifications for Template Host or an instance launch template for Launch Template as the template for purchasing instances.

        Password

        If you select Purchase Based on Existing Instance Specifications, you must select a logon key pair.

        Terms of Service

        Select Elastic Compute Service Terms of Service | Terms of Service for Images.

      • Existing Resources First: EDAS preferentially uses idle instances in the cluster to which your application belongs. If the number of idle instances in the cluster cannot meet the scale-out requirement, EDAS uses the auto scaling feature to purchase the required number of instances.

    5. Specify Number of Instances to Add for Each Scale-Out. This parameter specifies the number of instances that are automatically added after each scale-out is triggered.

    6. Specify Maximum Number of Instances in Group: This parameter specifies the maximum number of instances in the cluster. If the number of instances in the cluster reaches the parameter value, a scale-out is no longer triggered. Specify this parameter based on your resource limit.

View the auto scaling result

After a scale-out or scale-in is triggered based on the configured rule, you can use one of the following methods to check whether the rule takes effect:

  • On the basic information page of the application, check whether the number of instances is increased or decreased.

  • In the left-side navigation pane of the application details page, click Change Records. Find the change record whose change type is Scale Out or Scale in Application and source is auto_scale, click View in the Actions column. On the Change Details page, view the change details.

References

For more information about scale-outs in ECS clusters, see the following topics: