All Products
Search
Document Center

PolarDB:Traffic playback and stress testing

Last Updated:Mar 28, 2026

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.

    Note

    Keep 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:

ItemRequiredReference
DAS Professional EditionRequiredDAS Professional Edition overview
DTS data migrationRequiredBillable items
Traffic playback and stress testing clusterOptional — skip if using an existing clusterBillable items overview
Stress testing client (ECS)Optional — skip if using an existing ECS instanceBilling 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

  1. Log in to the DAS console.

  2. In the left-side navigation pane, click Traffic Playback and Stress Testing.

  3. On the Task Center page, click Create Task in the upper-right corner.

  4. In the Create Task dialog box, set the following parameters, then click Next.

    ParameterDescription
    Task TypeSelect Playback Traffic Stress Test.
    Task NameEnter a name of 2–50 characters.
    Instance SourceSelect Alibaba Cloud Database.
    Database EngineSelect PolarDB for MySQL as the source engine type.
    Source InstanceSelect 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.
  5. Configure the destination and playback settings, then click Next.

    ParameterDescription
    Database EngineSelect PolarDB for MySQL as the destination engine type.
    Benchmark Data MigrationSelect 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 SpecificationsSelect the DTS migration task specifications.
    Destination InstanceSelect the traffic playback and stress testing cluster. DAS connects to its primary endpoint by default.
    Privileged Account of Destination InstanceEnter the username and password of the privileged account for the traffic playback and stress testing cluster.
    Privileged Account of Source InstanceEnter the username and password of the privileged account for the source cluster.
    Select Playback TrafficSelect the time range for traffic replay. SQL Explorer and Audit must have been enabled on the source cluster for the entire selected period.
    Playback SpeedEnter 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-openjdk on the instance to install the Java client (Java 8 is recommended).

  6. 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:

TabWhat it showsHow to use the data
Cluster-level SummaryBasic information about the source and destination clusters before and after stress testingCompare overall cluster configuration and capacity.
Performance Trend ComparisonPerformance metrics collected from both clusters before and after the stress testing taskCompare metrics across clusters to identify whether the destination cluster needs to be scaled up.
SQL ComparisonSQL execution performance on both clusters, collected during the testIdentify 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 ComparisonValues of important parameters on both clustersCheck 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.