Before upgrading to a new major version of PolarDB for MySQL, use Database Autonomy Service (DAS) to replay production traffic against the target version cluster and measure performance. This lets you:
Check whether the new version cluster needs to be scaled up to effectively cope with business traffic spikes.
Identify SQL execution performance differences between the source and destination cluster versions before the actual upgrade.
Prerequisites
Before you begin, make sure you have:
A PolarDB for MySQL cluster running the target major version, used exclusively for testing. This cluster is referred to as the traffic playback and stress testing cluster throughout this topic.
NoteKeep the traffic playback and stress testing cluster out of production use.
Both the source cluster and the traffic playback and stress testing cluster connected to DAS.
DAS Professional Edition purchased for both clusters.
An Elastic Compute Service (ECS) instance in the same region as the traffic playback and stress testing cluster, to serve as the stress testing client. We recommend that you deploy the stress testing client and the traffic playback and stress testing cluster in the same Virtual Private Cloud (VPC) to minimize network latency.
You can purchase this ECS instance when you configure the stress testing task.
Billing
The following charges apply:
| Item | Required | Reference |
|---|---|---|
| DAS Professional Edition | Required | DAS Professional Edition overview |
| DTS data migration | Required | Billable items |
| Traffic playback and stress testing cluster | Optional — skip if using an existing cluster | Billable items overview |
| Stress testing client (ECS) | Optional — skip if using an existing ECS instance | Billing of instance types. If you let DAS provision the ECS instance automatically, it selects a pay-as-you-go instance sized to match the source cluster's QPS and the replay rate you specify. |
Usage notes
Stress testing does not affect the source cluster's performance. There is no need to run it during off-peak hours.
Before starting the task, verify that the stress testing client can reach the traffic playback and stress testing cluster over the network.
Create a stress testing task
Log in to the DAS console.
In the left-side navigation pane, click Traffic Playback and Stress Testing.
On the Task Center page, click Create Task in the upper-right corner.
In the Create Task dialog box, set the following parameters, then click Next.
Parameter Description Task Type Select Playback Traffic Stress Test. Task Name Enter a name of 2–50 characters. Instance Source Select Alibaba Cloud Database. Database Engine Select PolarDB for MySQL as the source engine type. Source Instance Select the source cluster ID. Advanced Settings (Optional) To limit testing to specific databases, expand Advanced Settings, enter the database account and password for those databases, click Obtain Database, and select the databases you want to test. Configure the destination and playback settings, then click Next.
Parameter Description Database Engine Select PolarDB for MySQL as the destination engine type. Benchmark Data Migration Select Create DTS Migration Task. DAS creates the Data Transmission Service (DTS) migration task automatically — no need to configure it in the DTS console separately. DTS Migration Task Specifications Select the DTS migration task specifications. Destination Instance Select the traffic playback and stress testing cluster. DAS connects to its primary endpoint by default. Privileged Account of Destination Instance Enter the username and password of the privileged account for the traffic playback and stress testing cluster. Privileged Account of Source Instance Enter the username and password of the privileged account for the source cluster. Select Playback Traffic Select the time range for traffic replay. SQL Explorer and Audit must have been enabled on the source cluster for the entire selected period. Playback Speed Enter a positive integer from 1 to 30. A value of 1 replays traffic at the original rate. If the specified rate exceeds the maximum rate the traffic playback and stress testing cluster can sustain, DAS caps it at the maximum supported rate. Advanced Settings Choose how to deploy the stress testing program:
DAS Automatic Purchase and Deployment: DAS provisions a pay-as-you-go ECS instance sized to the source cluster's QPS and the specified replay rate.
Add an existing ECS instance: Click Add, select the ECS instance, then click Generate Deployment Command. Copy the generated command and run it on that ECS instance. Also run
sudo yum install -y java-1.8.0-openjdkon the instance to install the Java client (Java 8 is recommended).
Click OK to submit the task.
View stress testing results
After the task is created, go to the Task Center page to monitor it. Use the Actions column to manage the task:
Details: Open the Traffic Playback and Stress Testing Details page.
Terminate: Stop the task before it completes.
Delete: Remove the task record.
The Traffic Playback and Stress Testing Details page has four tabs:
| Tab | What it shows | How to use the data |
|---|---|---|
| Cluster-level Summary | Basic information about the source and destination clusters before and after stress testing | Compare overall cluster configuration and capacity. |
| Performance Trend Comparison | Performance metrics collected from both clusters before and after the stress testing task | Compare metrics across clusters to identify whether the destination cluster needs to be scaled up. |
| SQL Comparison | SQL execution performance on both clusters, collected during the test | Identify queries with higher latency or error rates on the destination version. Use this to decide whether to update the database engine version or adjust cluster specifications before the upgrade. |
| Parameter Comparison | Values of important parameters on both clusters | Check for parameter mismatches that could affect behavior after upgrade. |
SQL Comparison data is collected regardless of whether the Enable Autonomy Service switch is turned on or off for the destination cluster.
Release resources
If you no longer need to perform stress testing, go to the Traffic Playback and Stress Testing Details page and release the ECS instance that was created to run the stress testing task. If you no longer need the traffic playback and stress testing cluster, release the cluster.