Help Center/ ServiceStage/ User Guide (ME-Abu Dhabi Region)/ User Guide/ Application O&M/ Configuring a Scaling Policy of an Application Component Instance
Updated on 2023-06-25 GMT+08:00

Configuring a Scaling Policy of an Application Component Instance

After scaling policies are set, instances can be automatically added or deleted based on resource changes or a specified schedule. This reduces manual resource adjustment to cope with service changes and service peak, helping you save resources and labor costs.

  • Auto scaling: Metric-based, scheduled, and periodic policies are supported. After configuration, instances can be automatically added or deleted based on resource changes or a specified schedule.
  • Manual scaling: The number of instances is increased or decreased immediately after the configuration is complete.

Graceful Scaling-In

You can set a graceful scaling-in time window to save important data before an application component instance stops. The value ranges from 0 to 9999, in seconds. The default value is 30. For example, if an application has two instances and only one instance will be kept after the scale-in operation, you can still perform certain operations on the instance to be stopped in the specified time window.

You can also set the maximum number of unavailable instances allowed during the rolling upgrade every day.

  1. Log in to ServiceStage and choose Application Management > Application List to view all applications.
  2. Click an application. The Overview page is displayed.
  3. On the Environment View tab, select an environment to view the application components that have been deployed in the environment.
  4. Click an application component. The Overview page is displayed.
  5. Choose Scaling.

    • Set Graceful Time Window (s). Specifically, click , enter a value, and click .
    • Set Maximum number of unavailable instances. Specifically, click , enter the maximum number (or select percentage and enter the maximum percentage), and click Save.

    Click View Component Details. The instance is displayed in the Upgrading/Rolling back the component state. When the status changes to Running, the scaling is complete.

Manual Scaling

  1. Log in to ServiceStage and choose Application Management > Application List to view all applications.
  2. Click an application. The Overview page is displayed.
  3. On the Environment View tab, select an environment to view the application components that have been deployed in the environment.
  4. Click an application component. The Overview page is displayed.
  5. Choose Scaling. In the Manual Scaling area:

    1. Click and change the number of instances.
    2. Click .

    Click View Component Details. The instance is displayed in the Upgrading/Rolling back the component state. When the status changes to Running, the scaling is complete.

Auto Scaling

  • CCE clusters of versions later than 1.15 do not support auto scaling.
  • VM deployment does not support auto scaling.
  1. Log in to ServiceStage and choose Application Management > Application List to view all applications.
  2. Click an application. The Overview page is displayed.
  3. On the Environment View tab, select an environment to view the application components that have been deployed in the environment.
  4. Click an application component. The Overview page is displayed. Choose Scaling.
  5. In the Auto Scaling area, click Edit Scaling Rule.

    1. Set Cooling Time, Maximum Instances, and Minimum Instances based on service requirements.
    2. Click Save.

  6. In the Auto Scaling area, click Add Scaling Policy.

    Currently, ServiceStage supports the following types of auto scaling policies:
    • Alarm Policy: scaling based on the CPU or memory settings. After an application component is deployed, instances in this application can be automatically scaled in or out when the number of CPU cores or memory amount exceeds or is less than a specified value.
      Table 1 Parameters for adding a metric-based policy

      Parameter

      Description

      Policy Name

      Name of the scaling policy.

      Policy Type

      Choose Alarm Policy.

      Metric

      Select a metric. Metrics reflect the resource performance or status.

      • CPU usage of the measured object. This metric indicates the percentage of the CPU cores actually used by the measured object to the total CPU cores that the measured object has applied for.
      • Physical memory usage. This metric indicates the percentage of the physical memory size used by the measured object to the physical memory size that the measured object has applied for.
      • Disk read rate, which indicates the data volume read from the disk per second.
      • Physical memory size that the measured object has applied for.
      • Data receiving rate, which indicates the data volume received by the measured object per second.
      • Disk write rate, which indicates the data volume written into the disk per second.
      • Size of the physical memory used by the measured object.
      • Total number of CPU cores that the measured object has applied for.
      • Data sending rate, which indicates the data volume sent by the measured object per second.
      • Number of error packets received by the measured object.
      • Number of CPU cores used by the measured object.

      Trigger Condition

      Condition based on which the scaling policy is triggered.

      Duration

      Metric statistics period.

      For example, if the parameter is set to 20s, metric statistics is collected every 20s.

      Continuous Cycle

      Number of consecutive times that the threshold is triggered.

      For example, if the parameter is set to 3, the action is triggered if the threshold is reached for three consecutive measurement periods.

      Action

      Select Add or Reduce to set the action to be executed after the policy is triggered.

      Click Show/Hide Preview to set Triggering Condition, Duration, Continuous Cycle, and Action.

    • Scheduled Policy: Instances in an application can be automatically scaled in or out at a specified time.
      Table 2 Parameters for adding a scheduled policy

      Parameter

      Description

      Policy Name

      Name of the scaling policy.

      Policy Type

      Choose Scheduled Policy.

      Trigger Time

      Set the time at which the policy is enforced.

      Action

      Select Add, Reduce, or Set to set the action to be executed after the policy is triggered.

    • Periodic Policy: Scaling policies can be executed daily, weekly, or monthly. This policy is applicable to scenarios where traffic changes periodically.
      Table 3 Parameters for adding a periodic policy

      Parameter

      Description

      Policy Name

      Name of the scaling policy.

      Policy Type

      Choose Periodic Policy.

      Trigger Time

      Set the time at which the policy is enforced.

      Action

      Select Add, Reduce, or Set to set the action to be executed after the policy is triggered.

  7. Click OK.

    In the Auto Scaling area, check that the policy has been started. When the trigger is met, the auto scaling policy immediately takes effect.