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. This topic describes how to create a stress testing task.

Prerequisites

Make sure that the database instances that are used in the stress testing task meet the following requirements:
  • The source database instance must be an ApsaraDB RDS for MySQL instance of the High-Availability Edition or the Enterprise Edition.
  • The destination database instance must be an ApsaraDB RDS for MySQL instance.
  • The source database instance and the destination database 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 database instance and the destination database instance. For more information, see DAS Professional Edition.

Additional considerations

  • 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 database instance in the same virtual private cloud (VPC).
  • Before you perform a stress test, you must check the connection between the stress testing client and the destination database instance. Make sure that traffic can be sent from the client to the destination database instance.

Pricing

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. The stress testing client is deployed on the ECS instance. The specifications of the ECS instance are selected based on the queries per second (QPS) of the source database instance and the specified playback rate. For information about the pricing of ECS instances, see ECS pricing.
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 costs, we recommend that you delete the pay-as-you-go ECS instance and destination database instance that are created by the system after the stress testing task is complete.

Create a stress testing task

  1. On the Task Center page, click Create Task in the upper-right corner.
  2. In the Create Task dialog box, configure the parameters.
    z
    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 Engine Select MySQL.
      Source Instance Select 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 the account that you use. 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 previous 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 Specify 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 the time range during which the traffic is replayed.
      Playback Speed Specify the rate at which the traffic captured from the source database instance is replayed on the destination database instance. For example, if you set this parameter to 1, the traffic is replayed on the destination database instance at the original rate. The value of the playback rate must be a positive integer. Valid values: 1 to 30.
      Note If the specified playback rate is higher than the maximum playback rate that the destination database instance supports, 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.
  3. 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.
    • Click Terminate to terminate the stress testing task before the task is complete.
    • Click Delete to delete the stress testing task.
    ss

What to do next

  1. If you do not need to perform stress testing again, on the Intelligent Stress Testing Details page you can release the ECS instance that is created to run the stress testing task.
  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 complete.

Related API operations