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 instances to handle workloads during peak hours. This topic describes how to create a stress testing task.

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, an ApsaraDB RDS for MySQL instance of the Enterprise Edition, a PolarDB for MySQL cluster of the Cluster Edition, a PolarDB for MySQL cluster of the Archive Database Edition, or a PolarDB-X 2.0 instance.
  • The destination database instance is an ApsaraDB RDS for MySQL instance, a PolarDB for MySQL cluster, or a PolarDB-X 2.0 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 enabled for the source instance and the destination instance. For more information, see Usage notes on DAS Professional Edition.
Note PolarDB-X 2.0 is supported only in the China (Hangzhou), China (Shanghai), China (Beijing), China (Shenzhen), and Singapore (Singapore) regions.

Procedure

In the following example, a Playback Traffic Stress Test task is created.

  1. Log on to the DAS console.
  2. In the left-side navigation pane, click Intelligent Stress Testing.
  3. On the Task Center page, click Create Task in the upper-right corner.
  4. 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.
    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 The type of the source database instance. Valid values:
      • MySQL
      • PolarDB MySQL
      • PolarDB-X 2.0
        Note PolarDB-X 2.0 is supported only in the China (Hangzhou), China (Shanghai), China (Beijing), China (Shenzhen), and Singapore (Singapore) regions.
      Source Instance 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.
      ss
      Parameter Description
      Database Engine The type of the destination database instance. The destination database instance must be an ApsaraDB RDS for MySQL instance, a PolarDB for MySQL cluster, or a PolarDB-X 2.0 instance that is deployed in the Singapore (Singapore) region.
      Benchmark Data Migration The method of data migration. Select a method based on whether the baseline data of the source database instance can be migrated to the destination database instance. Valid values:
      • Restore by Backup: Data in the source database instance is cloned to the destination database instance based on a specified point in time or a specified backup set.
        Note
        • Restore Mode: You can select By Time Point or By Backup Set. If you select By Backup Set, make sure that you are granted the required permissions. If you are 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.
      • Data Migration Completed: Data from the source database instance is migrated to the destination database instance. You do not need to use Data Transmission Service (DTS) to migrate the data.
        Note The destination database instance must have the same table schema and data type as the source database instance. Otherwise, the stress test cannot be performed.
      • Enter DTS Task ID: You can create a data migration task in the DTS console to migrate data from the source database instance to the destination database instance. Enter the ID of the DTS migration task in the Migration Task ID field.
        Note For more information about DTS, see DTS documentation.
      • Create DTS Migration Task: Create a DTS data migration task in this section. You do not need to create the migration task in the DTS console.
      Note
      • If the source database instance is an Alibaba Cloud database instance, you can select one of the preceding methods. We recommend that you select Restore by Backup. If you select Restore by Backup, after a stress testing task is created, the system automatically purchases a pay-as-you-go instance that has the same specification as the source database instance. The system exports the backup data of the source database instance to the purchased instance.
      • If the source database instance is a self-managed database instance, you can select Data Migration Completed, Enter DTS Task ID, or Create DTS Migration Task.
      Destination Instance Select the destination database instance. By default, the system accesses the primary endpoint of the destination database instance.
      Note You can click Advanced Settings next to the Destination Instance field to specify the endpoint of a cluster. This way, all nodes in the cluster can be tested. The Advanced Settings button becomes available only when the destination database instance is a PolarDB for MySQL cluster and the Benchmark Data Migration parameter is set to Data Migration Completed.
      Privileged Account of Source Instance The password of the privileged account for the source instance.
    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: 1 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, set the ECS that Deploys Stress Testing Program parameter.
      • If you set the 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.
      • If you want to deploy the stress testing program on your existing ECS instance, click Add to select the ECS instance and click Generate Deployment Command. Then, copy the generated command and run it on the ECS instance. In addition, you must run the sudo yum install -y java-1.8.0-openjdk command to install a Java client on the added ECS instance. The recommended version of the client is Java 8.
  5. Click OK.
    w
  6. After the stress testing task is created, you can view the information about the stress testing task on the Task Center page.
    ll
  7. 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 that is created to run the stress testing task.

Related API operations