All Products
Search
Document Center

PolarDB:Traffic playback and stress testing

Last Updated:Apr 30, 2025

This topic describes the traffic playback and stress testing feature of PolarDB-X.

Prerequisites

Scenarios

  • Verify whether the current database instance specifications need to be scaled up to prepare for upcoming short-term business peaks.

  • Validate the impact of schema changes in real-world business scenarios to reduce the risk of failures or performance issues after deploying the changes to production.

  • Recreate the failure scenario on a cloned database to identify the cause of the failure and implement corrective measures.

Precautions

  • To reduce network latency, deploy the stress testing client and the destination 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).

  • Stress testing does not affect the performance of the source instance. You do not need to perform stress testing during off-peak hours.

  • Before you perform stress testing, make sure that a stable connection is established between the stress testing client and the destination instance. Make sure that traffic can be sent from the client to the destination instance.

Procedure

  1. Click the SQL Explorer tab, and then click the Traffic Playback and Stress Test tab.

  2. Click Create Task. In the Configure Source Instance step, configure the parameters as needed.

    p950143

    Note
    • PolarDB-X instances are supported only in the China (Hangzhou), China (Shanghai), China (Beijing), China (Shenzhen), and Singapore regions.

    • Make sure that SQL Insight and Stress Testing (New Version) is enabled on the source instance in the traffic playback period.

  3. In the Configure Destination Instance step, configure the parameters as needed.

    p950165

    Parameter

    Description

    Database Engine

    The type of the destination instance. The destination instance must be an ApsaraDB RDS for MySQL instance, a PolarDB for MySQL cluster, or a PolarDB-X instance.

    Benchmark Data Migration

    The method that is used to migrate data. Select a method based on whether the baseline data of the source instance can be migrated to the destination instance. Valid values:

    • Restore by Backup: Data in the source instance is cloned to the destination 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 required 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 the 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 instance is migrated to the destination instance. You do not need to use Data Transmission Service (DTS) to migrate the data.

      Note

      The table schema and data type of the destination instance must be the same as the table schema and data type of the source instance. If the table schema and data type of the source instance and destination instance are not the same, 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 instance to the destination instance. Enter the ID of the DTS migration task in the Migration Task ID field.

      Note

      For more information about DTS, see Data migration.

    • 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

    The baseline data migration method that is supported varies based on the database type.

    Destination Instance

    Select the destination instance. By default, the system accesses the primary endpoint of the destination 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 option becomes available only when the destination instance is a PolarDB for MySQL cluster and the Benchmark Data Migration parameter is set to Data Migration Completed.

    Privileged Account of Destination Instance

    The password of the privileged account for the destination instance.

    Select Playback Traffic

    Specify a time range during 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.

    • If the specified playback rate is higher than the maximum playback rate of the destination instance, the traffic is replayed at the maximum playback rate.

    ECS that Deploys Stress Testing Program

    • If you set the parameter to DAS Automatic Purchase and Deployment, the system creates a pay-as-you-go ECS instance as a stress testing client based on the QPS of the source 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 the generated command and run the command on the ECS instance. You must also run the sudo yum install -y java-1.8.0-openjdk command to install a Java client on the added ECS instance. The recommended version of the client is Java 8.

  4. Click Next. After the precheck is performed, click OK to create the task.

  5. In the Actions column, you can perform the following operations:

    • Click Details to view the status and 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 instance and the destination instance before and after the stress testing task.

      Performance Trend Comparison

      You can compare the performance metrics that are collected from the source instance and the destination instance before and after the stress testing task.

      SQL Comparison

      If autonomy features are enabled for the destination instance before the stress testing test is started, the performance data of SQL execution is collected during stress testing. You can analyze and compare the performance of SQL execution on the source instance and the destination instance. For more information about how to enable autonomy features, see Enable or disable autonomy features.

      Note

      You can check whether you need to upgrade the database engine that your instance runs or change the specifications of your 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 instance and the destination instance.

    • To terminate the stress testing task before the task is completed, click Terminate.

    • To delete the stress testing task, click Delete.

    Note

    If you do not need to perform stress testing again, go to the Intelligent Stress Testing Details page and release the ECS instance that is created to run the stress testing task.