Database Autonomy Service (DAS) provides the traffic playback and 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, 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.
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 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
- For more information about the pricing of DAS Professional Edition, see Usage notes on DAS Professional Edition.
- 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 database
instance based on the destination database instance that you select. For information
about the pricing, see the pricing of the corresponding database service.
- 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 To reduce additional 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
- Log on to the DAS console.
- In the left-side navigation pane, click Instance Monitoring.
- In the left-side navigation pane, click SQL Explorer and Audit. On the page that appears, click the SQL Explorer tab.
- In the left-side navigation pane of the page that appears, click SQL Explorer and Audit. Then, on the page that appears, click Traffic Playback and Stress Test.
- In the upper-right corner of the tab, click Create Task. In the Create Task dialog box that appears, configure the parameters.

- Set the Task Type parameter to Playback Traffic Stress Test and specify the Task Name parameter.
Note Make sure that the SQL Explorer and audit feature is enabled for the source database instance during the traffic playback period.
- In the Source Information section, configure the parameters in the following table. Then, click Next.
Parameter |
Description |
Instance Source |
Select Alibaba Cloud Database.
|
Database Engine |
Select the database engine of the source database instance.
- MySQL
- PolarDB MySQL
- PolarDB-X
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.
|
- In the Generation Method of Schema and Data of Destination Database section, configure the parameters that are described in the following table.

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.
- 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. |
- 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.
|
- In the Advanced Settings section, set ECS that Deploys Stress Testing Program.
- If you select 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 and
run the deployment command on the ECS instance. In addition, you must run the
sudo yum install -y java-1.8.0-openjdk
command to install the Java client on the ECS instance. The recommended version of
the client is Java 8.
- Click Next. After you confirm the configurations, click OK. Then, the task is created.
View stress testing results
- After the stress testing task is created, you can view the information about the stress
testing task on the Task Center page.
- 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 is 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.

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.
What to do next
- 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.
- To reduce extra costs, delete the destination database instance and the ECS instance
that are created to run the stress testing task.
- 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.