Database Autonomy Service (DAS) provides the auto scaling feature. During peak hours, DAS automatically scales up a database instance to cope with traffic peaks and ensure business stability. DAS monitors the CPU usage of the database instance in real time. If the CPU usage per unit of time decreases, DAS automatically scales down the database instance. This topic describes how to enable the auto scaling feature.

Prerequisites

  • A PolarDB database is connected to DAS.
  • The autonomy service is enabled for the database instance. For more information, see Autonomy center.

Scenario

An ApsaraDB for PolarDB instance is connected to DAS and the auto scaling feature is enabled. During peak hours, DAS automatically scales up the instance. This doubles the read/write throughput and lowers the CPU usage from more than 90% to 25%, which allows the instance to run under high load for nearly 10 hours. After the read and write traffic decreases and the CPU usage drops to less than 25%, DAS automatically scales the instance down to the original specification.

In this way, DAS effectively ensures the stability of online business.

Procedure

  1. Log on to the DAS console.
  2. In the left-side navigation pane, click Instance Monitoring.
  3. On the Instance Monitoring page, find the target instance and click the instance ID to go to the instance details page.
  4. In the left-side navigation pane, click Autonomy Center.
  5. On the Autonomy Center page, click Switch Settings in the upper-right corner.
  6. In the Switch Settings dialog box, turn on Automatic Scale-out and set the parameters, as described in the following table.
    Parameter Description
    Maximum Specifications The upper limit of the specification of the database instance. DAS adjusts the specification of a database instance one level at a time, for example, from four cores to eight cores and then to 16 cores, until the specification reaches the specified upper limit.
    Observation Window The time window during which DAS monitors the CPU usage of the database instance. If the CPU usage of the database instance meets the condition in an observation window, DAS automatically scales up the specification of the instance upon the end of the observation window. The default condition is that the CPU usage exceeds 70% for more than half of an observation window. A custom condition will be supported soon.
    Quiescent Period The minimum interval between two scaling operations. During a quiescent period, DAS still monitors the CPU usage of the instance but does not perform auto scaling. If a quiescent period and an observation window end at the same time and the CPU usage of the monitored instance meets the condition in the observation window, DAS automatically scales up the specification of the instance upon the end of the quiescent period and the observation window.

  7. Turn on Automatic Scale-in based on your actual needs.
    Note After you turn on Automatic Scale-in, if the CPU usage of the monitored instance meets the condition in an observation window, DAS automatically scales down the specification of the instance upon the end of the observation window. The default condition is that the CPU usage is less than 30% for 99% of an observation window. The lowest specification to which an instance can be scaled down is its original specification. A custom condition will be supported soon.
  8. Click OK.