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 or the Enterprise Edition, or an ApsaraDB PolarDB for MySQL instance of the Cluster Edition or the Archive Database Edition.
  • The destination database instance is an ApsaraDB RDS for MySQL instance or an ApsaraDB PolarDB MySQL-compatible edition instance.
  • The source database instance and the destination database instance are connected to DAS. For more information, see Connect Alibaba Cloud database instances to DAS.
  • DAS Professional Edition is activated for the source database instance and the destination database instance. For more information, see DAS Professional Edition.

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. Configure the Task Type parameter based on your business requirements and enter a task name in the Task Name field.
      Task Type Description
      Playback Traffic Stress Test DAS replays the traffic that is captured from the source database instance on the destination database instance at a specified rate.
      Traffic Generation Stress Testing DAS captures traffic from the source database instance for a short period of time and analyzes the captured traffic. Then, DAS generates traffic on the destination database instance for continuous stress testing. The traffic that is generated based on the business model of the source database instance and the traffic distribution on the destination database instance are consistent with those on the source database instance. This reduces the amount of time that is used to collect data from the source database instance and reduces storage costs and performance overheads.
      Benchmark Stress Testing (previously known as Peak Stress Testing) DAS replays the traffic that is captured from the source database instance on the destination database instance at the maximum playback rate that the destination database instance supports.
      Note This task type is not supported.
    2. In the Source Information section, configure the parameters that are described in the following table.
      Parameter Description
      Instance Source The source of the source database instance. Valid values:
      • Alibaba Cloud Database
      • ECS-based Self-Managed Database
      • Self-managed Databases and Other Cloud Databases
      Database Engine The type of the source database instance. Valid values:
      • MySQL
      • PolarDB MySQL
      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.
      a
      Parameter Description
      Database Engine The type of the destination database instance. The destination database instance must be an ApsaraDB RDS for MySQL instance or an ApsaraDB PolarDB MySQL-compatible edition instance.
      Benchmark Data Migration The method of data migration. You can select one of the following migration methods. Select a method based on whether the baseline data of the source database instance can be migrated to the destination database instance.
      • 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: You can create a DTS data migration task on this page. You do not need to create a 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, the system automatically creates a pay-as-you-go destination database instance that has the same specifications as the source database instance. Then, the system migrates specified data from the source database instance to the destination database 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.
      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 The time range during which the traffic is replayed.
      Stress Testing Duration in Destination Instance The duration for which the stress testing task runs on the destination database instance. The maximum duration is 1,440 minutes.
      Note If you specify Traffic Generation Stress Testing as the task type, this parameter becomes available.
      Playback Speed 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.
      Note In the Advanced Settings section, you can set the ECS that Deploys Stress Testing Program parameter to DAS Automatic Purchase and Deployment. Click Add and on the page that appears, select the ECS instance on which you want to deploy the stress testing program 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 supported runtime environment 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.
  7. In the Actions column, you can perform the following operations:
    • Click Details to view the status and the result 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 completed.
    • Click Delete to delete the stress testing task.
    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.

Related API operations