All Products
Search
Document Center

PolarDB:Intelligent stress testing

Last Updated:Dec 21, 2023

This topic describes how to perform intelligent stress testing before a major version upgrade.

Overview

Database Autonomy Service (DAS) provides the intelligent stress testing feature. Before you upgrade the PolarDB major version, you can use the intelligent stress testing feature to simulate your business traffic running in a PolarDB cluster of a specified version. This helps you achieve the following goals:

  • Check whether your cluster needs to be scaled up to effectively cope with business traffic spikes.

  • Analyze performance differences in SQL execution between the source and destination versions of the PolarDB cluster.

Prerequisites

  • A cluster of the same major version as the upgraded cluster is created for intelligent stress testing. You can also purchase the cluster when you configure the intelligent stress testing task. This cluster is referred to as the intelligent stress testing cluster.

    Note

    Do not use the intelligent stress testing cluster in the production environment.

  • Both the source cluster and the intelligent stress testing cluster are connected to DAS. For more information, see Connect an Alibaba Cloud database instance to DAS.

  • DAS Professional Edition is purchased for both the source cluster and the intelligent stress testing cluster. For more information, see Purchase DAS Professional Edition.

  • An ECS instance that is in the same region as the intelligent stress testing cluster is created to serve as the stress testing client. You can also purchase the ECS instance when you configure the intelligent stress testing task. .

    Note

    We recommend that you deploy the stress testing client and the intelligent stress testing cluster in the same VPC.

Precautions

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

  • Before the intelligent stress testing starts, check the connectivity between the stress testing client and the intelligent stress testing cluster. Make sure that the stress testing client can send traffic to the intelligent stress testing cluster.

Fees

The following fees are incurred in the intelligent stress testing:

  • Fees for purchasing DAS Professional Edition. For more information, see DAS Professional Edition overview.

  • Fees for data migration over DTS. For more information, see Billable items.

  • Fees for purchasing the intelligent stress testing cluster (optional). For more information, see Billable items overview. If you use an existing instance, you can skip this item.

  • Fees for purchasing the stress testing client (optional). If you choose to purchase a new ECS instance as the stress testing client when you configure the intelligent stress testing task, the system selects a pay-as-you-go ECS instance of the appropriate specifications based on the source instance QPS and the specified replay rate. For more information, see Billing of instance types.

Procedure

Create a stress testing task

In the following example, a Playback Traffic Stress Test task is created.

  1. Log on to the DAS console.

  2. In the left-side navigation pane, click Intelligent Stress Testing.

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

  4. In the Create Task dialog box, configure the parameters.

    Parameter

    Description

    Task Type

    Select Playback Traffic Stress Test.

    Task Name

    The name of the stress testing task. The name must be 2 to 50 characters in length.

    Instance Source

    Select Alibaba Cloud Database.

    Database Engine

    The type of the source instance. Select PolarDB for MySQL.

    Source Instance

    The ID of the source instance.

    Advanced Settings

    If you want to perform intelligent stress testing on one or more databases in the source instance, click Advanced Settings to specify the database account and password of the destination databases. Click Obtain Database to obtain the required databases, and then select the destination databases on which you want to perform intelligent stress testing.

  5. Click Next and configure the following parameters.

    Parameter

    Description

    Database Engine

    The type of the destination instance. Select PolarDB for MySQL.

    Benchmark Data Migration

    Select Create DTS Migration Task.

    Note

    If you select Create DTS Migration Task, the system creates a data migration task. You do not need to go to the DTS console.

    DTS Migration Task Specifications

    The specifications of the DTS migration task.

    Destination Instance

    The intelligent stress testing cluster. By default, the system accesses the primary endpoint of the intelligent stress testing cluster.

    Privileged Account of Destination Instance

    The username and password of the privileged account for the intelligent stress testing cluster.

    Privileged Account of Source Instance

    The username and password of the privileged account for the source instance.

    Select Playback Traffic

    The time range within which the traffic is replayed.

    Note

    Make sure that the SQL Explorer and Audit feature is enabled for the source instance within the specified time range.

    Playback Speed

    The rate at which the traffic captured from the source instance is replayed on the intelligent stress testing cluster. For example, if you set this parameter to 1, the traffic is replayed on the intelligent stress testing cluster at the original rate. The replay rate must be a positive integer. Valid values: 1 to 30.

    Note

    If the specified replay rate is higher than the maximum replay rate that is supported by the intelligent stress testing cluster, the traffic is replayed at the maximum replay rate.

    Advanced Settings

    Select ECS that Deploys Stress Testing Program.

    Note
    • If you set the parameter to DAS Automatic Purchase and Deployment, the system creates a pay-as-you-go ECS instance based on the QPS of the source instance and the specified replay 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. In addition, you must run the sudo yum install -y java-1.8.0-openjdk command to install a Java client on the added ECS instance. We recommend that you install Java 8.

  6. Click Next.

  7. Click OK.

View intelligent stress testing details

After the stress testing task is created, you can view the information about the stress testing task on the Task Center page. You can perform the following operations in the Actions column:

  • Click Details to view the state and report of the stress testing task on the Intelligent Stress Testing Details page. The following table describes the parameters.

    Parameter

    Description

    Cluster-level Summary

    You can compare the basic information about 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 the Enable Autonomy Service switch is turned on for the destination 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 instance and the destination instance before and after the stress testing task.

    Note

    You can determine whether to update 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 instance and the destination instance.

  • Click Terminate to terminate the stress testing task before the task is completed.

  • Click Delete to delete the stress testing task.

Release intelligent stress testing resources

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