Traffic playback and stress testing lets you replay captured production traffic on a target database instance at a configurable speed, so you can assess whether the instance's current specifications can handle your peak workload — without risking your production environment.
The end-to-end workflow has three phases:
Capture — DAS collects traffic from the source instance via SQL Explorer and Audit.
Replay — DAS replays the captured traffic on the destination instance at 1× to 30× the original speed.
Analyze — Compare SQL execution performance between the source and destination to decide whether to scale up or scale out.
This topic walks you through creating a stress testing task in the DAS console.
Prerequisites
Before you begin, make sure:
The source instance is one of the following types:
ApsaraDB RDS for MySQL
PolarDB for MySQL (Single Node Edition is not supported)
PolarDB-X 2.0
The destination instance is one of the following types:
ApsaraDB RDS for MySQL
PolarDB for MySQL
PolarDB-X 2.0
Both the source and destination instances are connected to DAS.
DAS Enterprise Edition is enabled for the source instance. To compare SQL execution performance between the source and destination after the test, also enable DAS Enterprise Edition for the destination instance.
SQL Explorer and Audit is enabled on the source instance for the time range you plan to replay.
PolarDB-X 2.0 is supported only in the China (Hangzhou), China (Shanghai), China (Beijing), China (Shenzhen), and Singapore regions.
Choose a data migration method
Before creating the task, decide how to populate the destination instance with a copy of the source data. The method you choose determines which parameters appear in the task creation form.
| Method | How it works | When to use |
|---|---|---|
| Restore by Backup | DAS automatically creates a pay-as-you-go instance with the same specifications as the source and restores a backup to it. | Source is an Alibaba Cloud database. This is the recommended method — it requires the least manual work. |
| Data Migration Completed | The destination already has the same table schemas and data as the source for the replay time range. | You have already migrated the data manually and verified consistency. |
| Enter DTS Task ID | A Data Transmission Service (DTS) migration task is already running or completed. | You have an existing DTS task ID and want to reuse it. |
| Create DTS Migration Task | DAS creates a DTS task on your behalf. | Source is an Alibaba Cloud database and you prefer DAS to handle DTS setup. |
If the source is a self-managed database, only Data Migration Completed, Enter DTS Task ID, and Create DTS Migration Task are available.
Create a stress testing task
Navigate to Traffic Playback and Stress Testing
Log on to the DAS console.
Go to the Traffic Playback and Stress Testing page using one of the following methods:
In the left-side navigation pane, click Traffic Playback and Stress Testing.
Navigate from an instance details page:
In the left-side navigation pane, click Instance Monitoring.
Find the instance and click its ID.
In the left-side navigation pane, choose Request Analysis > SQL Explorer and Audit. On the SQL Explorer tab, click the Traffic Playback and Stress Test tab.
On the Task Center page, click Create Task in the upper-right corner.
Configure the task
Step 1: Set the task type and name
In the Create Task dialog box, set Task Type to Playback Traffic Stress Test and enter a Task Name.
Step 2: Configure source information
| Parameter | Description |
|---|---|
| Instance source | Select Alibaba Cloud Database. |
| Database engine | Select the engine type of the source instance: MySQL (ApsaraDB RDS for MySQL), PolarDB for MySQL, or PolarDB-X (PolarDB-X 2.0). |
| Source instance | Select the source instance ID. |
| Advanced settings (optional) | To limit playback to specific databases within the source instance, click Advanced Settings, enter the Database Account and Password for the destination databases, click Obtain Database, and select the databases. |
Click Next.
Step 3: Configure the destination instance
| Parameter | Description |
|---|---|
| Database engine | Select the engine type of the destination instance: MySQL, PolarDB for MySQL, or PolarDB-X. |
| Benchmark data migration | Select the data migration method that fits your situation. |
| Restore mode | (Appears when Benchmark Data Migration is Restore by Backup.) Select By Time Point or By Backup Set. If you select By Backup Set and your account lacks the required permissions, click DAS Service-linked Role and then OK to grant access. |
| Select restore time / Backup set | (Appears when Benchmark Data Migration is Restore by Backup.) Specify the point in time or backup set from which to restore data. |
| Migration task ID | (Appears when Benchmark Data Migration is Enter DTS Task ID.) Enter the ID of the existing DTS migration task. |
| DTS migration task specifications | (Appears when Benchmark Data Migration is Create DTS Migration Task.) Select the specifications for the DTS task. |
| Destination instance | (Appears when Benchmark Data Migration is Data Migration Completed, Enter DTS Task ID, or Create DTS Migration Task.) Select the destination instance. DAS connects to its primary endpoint by default. |
| Privileged account of destination instance | (Appears for Data Migration Completed, Enter DTS Task ID, and Create DTS Migration Task.) Enter the privileged account name and password for the destination instance. |
| Privileged account of source instance | (Appears for Restore by Backup and Create DTS Migration Task.) Enter the privileged account name and password for the source instance. |
Step 4: Configure stress testing settings
| Parameter | Description |
|---|---|
| Select playback traffic | Select the time range of traffic to replay. SQL Explorer and Audit must have been enabled on the source instance for this entire time range. |
| Playback speed | Set the replay rate as a multiplier of the original traffic speed. The playback rate must be a positive integer. Valid values: 1–30. A value of 1 replays traffic at the original rate. If the specified rate exceeds what the destination instance supports, DAS replays at the maximum supported rate. |
Step 5: Configure the stress testing client (ECS)
Set ECS that Deploys Stress Testing Program:
DAS Automatic Purchase and Deployment — DAS creates a pay-as-you-go ECS instance sized to the source QPS and the playback rate. No further action is needed.
Use your own ECS instance — Click Add, select your ECS instance, and click Generate Deployment Command. Copy and run the generated command on that ECS instance. Also run the following command to install a Java client. We recommend that you install Java 8:
sudo yum install -y java-1.8.0-openjdk
Submit the task
Click Next. After verification succeeds, click OK to create the task.
What's next
SQL Explorer and Audit — review the SQL execution details captured during the playback.
Enable and manage DAS Enterprise Edition — required to access the performance comparison report.
Data migration (DTS) — learn how DTS migrates data between instances.