Database Autonomy Service (DAS) provides the intelligent stress testing feature. This feature helps you check whether you need to scale up or scale out your database instance to handle workloads during peak hours.

Prerequisites

Make sure that your database instances meet the following requirements:
  • The source database instance is an ApsaraDB RDS for MySQL instance of the High-availability Edition or the Enterprise Edition, or an ApsaraDB PolarDB MySQL-compatible edition instance of the Cluster Edition or the Archive Database Edition.
  • The destination instance is an ApsaraDB RDS for MySQL instance or an ApsaraDB PolarDB MySQL-compatible edition instance.
  • The source instance and the destination instance are connected to DAS. For information about how to connect database instances to DAS, see Connect an Alibaba Cloud database instance to DAS.
  • DAS Professional Edition is activated for the source instance and the destination instance. For more information, see DAS Professional Edition.

Precautions

  • To reduce network latency, you must deploy the stress testing client and the destination database instance in the same region.
    Note We recommend that you deploy the stress testing client and the destination instance in the same virtual private cloud (VPC).
  • Before you perform a stress testing, you must check the connectivity between the stress testing client and the destination instance. Make sure that traffic can be sent from the client to the destination instance. Before you perform a stress testing, you must check the connectivity between the stress testing client and the destination instance. Make sure that traffic can be sent from the client to the destination instance.

Billing

After you create a stress testing task, you are charged based on the following rules:
  • If you use the Restore by Backup method to migrate data, the system automatically creates a pay-as-you-go ApsaraDB RDS for MySQL instance as the destination database instance. For information about the pricing, see ApsaraDB RDS pricing.
  • If you select DAS Automatic Purchase and Deployment in the Advanced Settings section, the system automatically creates a pay-as-you-go Elastic Compute Service (ECS) instance as the stress testing client. The specification of the ECS instance is selected based on the queries per second (QPS) of the source database instance and the specified playback rate. For information about the pricing, see ECS billing methods.
Note
  • Make sure that DAS Professional Edition is activated for the source database instance. For more information, see Pricing of DAS Professional Edition.
  • To reduce extra costs, we recommend that you delete the pay-as-you-go instances that are created by the system after the stress testing task is completed.

Procedure

  1. Log on to the DAS console.
  2. In the left-side navigation pane, click Instance Monitoring. On the Instance Monitoring page, click the ID of the instance that you want to manage.
  3. In the left-side navigation pane of the page that appears, click SQL Explorer and Audit. Then, click the Traffic Playback and Stress Test tab. In the upper-right corner of the tab, click New Task.
  4. In the New Task dialog box, configure the parameters.
    aa
    1. Set the Task Type parameter to Playback Traffic Stress Test and specify a Task name.
      Note Make sure that the SQL Explorer and audit feature is enabled for the source database instance during the traffic playback period.
    2. In the Source Information section, configure the parameters that are described in the following table.
      Parameter Description
      Instance Source Select Alibaba Cloud Database.
      Database type Select MySQL.
      Source cases The ID of the source database instance.
    3. In the Generation Method of Schema and Data of Destination Database section, configure the parameters that are described in the following table.
      a
      Parameter Description
      Database Engine Select MySQL.
      Benchmark Data Migration Select Restore by Backup as the data migration method. If you select this method, the data in the source database instance is cloned in the destination database instance based on a specified point in time or a specified backup set.
      Restore Mode You can select By Time Point or By Backup Set.
      Note If you select By Backup Set, make sure that your account is granted the required permissions. If your account is not granted the permissions, click DAS Service-linked Role to assign the associated role to your account. In the message that appears, click OK.
      Select Restore Time/Backup Set If you set the Restore Mode parameter to By Time Point, specify a point in time to migrate data that is saved at the specified point in time. If you set the Restore Mode parameter to By Backup Set, select a backup set to migrate the data from the selected backup set.
      Note You can set the Select Restore Time parameter to a point in time within the most recent seven days. For example, if the current time is 2021-07-25 21:00:00, you can specify a point in time from 2021-07-18 21:00:00 to 2021-07-25 21:00:00.
      Privileged Account of Source Instance The name and the password of the privileged account that is used to manage the destination database instance. For more information, see Create an ApsaraDB RDS account.
    4. In the Stress Testing Basic Settings section, configure the parameters that are described in the following table.
      Parameter Description
      Select Playback Traffic Specify a time range within which the traffic is replayed.
      Playback Speed The rate at which the traffic captured from the source instance is replayed on the destination instance. For example, if you set this parameter to 1, the traffic is replayed on the destination instance at the original rate. The value of the playback rate must be a positive integer. Valid values: 0 to 30.
      Note If the specified playback rate is higher than the maximum playback rate that is supported by the destination database instance, the traffic is replayed at the maximum playback rate.
    5. In the Advanced Settings section, click Add next to the ECS That Deploys Stress Testing Program field. In the dialog box that appears, select an ECS instance and click Generate Deployment Command. Then, copy the generated command and run it on the ECS instance. In this case, you must deploy a Java client. The default runtime environment is Java 8.
      Note If you set the ECS That Deploys Stress Testing Program parameter to DAS Automatic Purchase and Deployment, the system creates a pay-as-you-go ECS instance as the stress testing client based on the QPS of the source database instance and the specified playback rate.
  5. Click OK.
    w

View stress testing results

  1. After the stress testing task is created, you can view the information about the stress testing task on the Task Center page.
    ss
  2. In the Actions column, you can perform the following operations:
    • Click Details to view the status and the report of the stress testing task on the Intelligent Stress Testing Details page. The following table describes the parameters.
      Parameter Description
      Overview You can compare the basic information that are collected from the source database instance and the destination database instance.
      Performance Trend Comparison You can compare the performance metrics that are collected from the source database instance and the destination database instance.
      SQL Comparison If DAS Professional Edition is purchased for the destination database instance before the stress testing , the performance data of SQL execution is collected during the stress testing. You can analyze and compare the performance of SQL execution on the source database instance and the destination database instance.
      Note You can check whether you need to upgrade the database engine that your database instance runs or change the specifications of your database instance based on the information that is displayed on the SQL Comparison tab.
      Parameter Comparison You can compare the values of important parameters that are collected from the source database instance and the destination database instance.
    • Click Terminate to terminate the stress testing task before the task is complete.
    • Click Delete to delete the stress testing task.
    ll
    Note If you do not need to perform stress testing again, on the Intelligent Stress Testing Details page, you can release the ECS instance and the destination database instance that are created to run the stress testing task.

What to do next

  1. If you do not need to perform stress testing again, you can release the ECS instance that is created to run the stress testing task on the Intelligent Stress Testing Details page.
  2. To reduce extra costs, delete the destination database instance and the ECS instance that are created to run the stress testing task.
  3. If the SQL Explorer and audit feature is enabled for the source database instance, you can disable the feature after the stress testing task is completed.