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

The database instances that are used for stress testing must meet the following requirements:
  • The source database instance is a High-availability Edition or Enterprise Edition instance of ApsaraDB RDS for MySQL, or a Cluster Edition or Archive Database Edition instance of the ApsaraDB PolarDB MySQL-compatible edition.
  • The destination database instance is an ApsaraDB RDS for MySQL instance or a ApsaraDB PolarDB MySQL-compatible edition 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 Access an Alibaba Cloud database instance.
  • DAS Professional Edition are activated for the source database instance and the destination database instance. For more information, see DAS Professional Edition.

Scenario

  • Check whether your ApsaraDB RDS for MySQL instance or ApsaraDB PolarDB MySQL-compatible edition instance needs to be scaled up or scaled out to handle workloads during peak hours.
  • Before you migrate data from your databases to Alibaba Cloud, check whether the specification of the destination ApsaraDB RDS for MySQL instance or ApsaraDB PolarDB MySQL-compatible edition instance meets your business requirements.

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 creates a pay-as-you-go ApsaraDB RDS for MySQL instance or a pay-as-you-go ApsaraDB PolarDB MySQL-compatible edition instance as the destination database instance based on the type of the destination database that you specify. For information about the pricing, see ApsaraDB RDS pricing and Billable items of the ApsaraDB PolarDB MySQL-compatible edition.
  • 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 of ECS instances, see ECS pricing.
Note
  • If the source database instance is an ApsaraDB RDS for MySQL instance or a PolarDB for MySQL instance, you must purchase DAS Professional Edition. For information about the pricing of DAS Professional Edition, see Pricing of DAS Professional Edition.
  • To reduce 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

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 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 Replays the traffic that is captured from the source database instance on the destination database instance at a specified rate.
      Traffic Generation Stress Testing Analyzes the traffic that is captured from the source database instance in a short period of time and generates traffic on the destination database instance for continuous stress testing based on the analysis result. The business model and the distribution of the traffic 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) 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 described in the following table.
      Parameter Description
      Instance Source The data source for the destination 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 described in the following table.
      a
      Parameter Description
      Database Engine The destination database instance must be an ApsaraDB RDS for MySQL instance or an ApsaraDB PolarDB MySQL-compatible edition instance.
      Benchmark Data Migration You can select one of the following migration methods based on whether the baseline data of the source database instance is 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 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.
      • 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 traffic stress testing cannot be performed.
      • Enter DTS Task ID: You 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 create a DTS data migration task in this section. 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 specification 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 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 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.