Database Autonomy Service (DAS) provides intelligent stress testing to help you determine whether you need to scale up your instance to handle traffic spikes. This topic describes how to create an intelligent stress testing task.
Prerequisites
Your database instances must meet the following requirements:
-
The source database must be an ApsaraDB RDS for MySQL instance that runs the High-Availability Edition or Enterprise Edition with three nodes.
-
The destination database must be an ApsaraDB RDS for MySQL instance.
-
The instances must be connected to DAS. For more information, see Connect an Alibaba Cloud database instance to DAS.
-
DAS Professional Edition must be enabled. For more information, see DAS Professional Edition.
Usage notes
-
To reduce network latency, the stress testing client and the destination instance must be in the same region.
NoteWe recommend that you place the stress testing client and the destination instance in the same virtual private cloud (VPC).
-
Before you start the stress test, verify that the stress testing client can connect to the destination instance.
Billing
After you create a stress testing task, you are charged for the following items:
-
If you select Restore by Backup to migrate data, the system purchases a pay-as-you-go ApsaraDB RDS for MySQL instance. For more information, see ApsaraDB RDS pricing.
-
If you select DAS Automatic Purchase and Deployment in the Advanced Settings section, the system purchases a pay-as-you-go ECS instance with appropriate specifications based on the QPS of the source database and the specified playback rate. For more information, see ECS pricing.
-
If your source database instance is ApsaraDB RDS for MySQL, purchase DAS Professional Edition. For more information, see Billing details.
-
To avoid unnecessary charges, manually delete these pay-as-you-go instances after the stress testing task is complete.
Procedure
-
On the Tasks page, click Create Task in the upper-right corner.
-
In the Create Task dialog box, set the following parameters.
-
Set Task Type to Playback Traffic Stress Test and enter a Task Name.
NoteMake sure that SQL Explorer and Audit is enabled for the source instance during the specified traffic playback period.
-
In the Source Information section, set the following parameters.
Parameter
Description
Instance Source
Select Alibaba Cloud Databases.
Database Type
Select MySQL.
Source Instance
Select the Source Instance.
-
In the Generation Method of Schema and Data of Destination Database section, set the following parameters.
If you set Benchmark Data Migration to Data Migration Completed, you must configure the Destination Instance, Endpoint, and the privileged account and password for the destination instance.
Parameter
Description
Database Type
The destination instance must be ApsaraDB RDS for MySQL.
Benchmark Data Migration
Select Restore by Backup as the data migration method. This method clones the source instance to create the destination instance based on a point in time or a backup set.
Restore Mode
You can select By Time Point or By Backup Set.
NoteIf you select By Backup Set, you must grant permissions to the DAS-linked Role. In the dialog box that appears, click OK.
Select Restore Time/Backup Set
Select a specific time or backup set for the restore.
NoteYou can restore data to any point in time within the last seven days. For example, if the current time is 21:00:00 on 2021-07-25, the available time range for restore is from 21:00:00 on 2021-07-18 to 21:00:00 on 2021-07-25.
Privileged Account of Source Instance
The username and password of the privileged account for the source instance. For more information, see Create an ApsaraDB RDS account.
-
In the Stress Testing Basic Settings section, set the following parameters.
Parameter
Description
Select Playback Traffic
Select the time range of the traffic to replay.
Playback Speed
The rate for replaying source instance traffic on the destination instance. For example, a rate of 1x means the traffic is replayed at its original speed. The playback rate must be a positive integer. Valid values: 1 to 30.
NoteIf the playback rate you set exceeds the maximum speed supported by the destination instance, the task runs at the maximum supported speed.
-
In the Advanced Settings section, click Add, select an ECS instance in the dialog box that appears, and then click Generate Deployment Command. Copy the command and run it on your host machine. This deploys a Java client. The default client version is Java 8.
NoteIf you select DAS Automatic Purchase and Deployment for ECS that Deploys Stress Testing Program, the system purchases a pay-as-you-go ECS instance with appropriate specifications based on the QPS of the source database and the specified playback rate.
-
-
Click OK to create the stress testing task.
A dialog box appears, showing the resources that will be provisioned on a pay-as-you-go basis for the task: a destination instance of type
mysql.n2.large.25 (4 cores, 8 GB)and an ECS instance of typeecs.g5.xlarge (4 cores, 16 GB)for the stress testing program. You must manually delete these resources after the task is complete to avoid incurring additional charges. You can click OK to submit the task only after the checks for SQL Explorer and audit and Target Instance Check are successful.
Stress testing results
-
After creating the task, return to the Tasks page to view its details.
At the top of the Task Center page, you can filter tasks by Status, Task Type, and Time Range, and click Create Task to create a new stress testing task. The task list includes columns such as Task ID, Task Name, Task Type (for example, Cloud Migration Stress Test or Playback Stress Test), Status, Task Progress (for example, Full SQL Preparation or Completed), Traffic Start Time, and Traffic End Time. The Actions column provides options to view Details, Terminate, or Delete a task.
-
In the Actions column on the right, you can perform the following operations:
-
Click Details to view the task execution status and performance report on the Intelligent Stress Testing Details page.
-
Click Terminated to stop a task before it completes.
-
Click Delete to delete the stress testing task you created.
The Intelligent Stress Testing Details page contains two sections: Task Basic Information and Task Process. The Task Basic Information section displays fields such as Task ID, Task Name, Source Instance Type, Target Instance Type, Source Instance, Target Instance, Status, Traffic Capture Duration, Rate, and Working Directory. The Task Process section shows the seven steps of the task: Pre-check → Target Instance Preparation → Stresser Preparation → Full SQL Preparation → Stress Testing in Progress → Resource Cleanup → Completed.
-
Next steps
-
After the task completes, release the associated ECS instance on the Intelligent Stress Testing Details page unless you plan to run another test.
-
To avoid unnecessary charges, manually delete the purchased resources: the destination instance and the ECS instance used for the stress testing program.
-
If you manually enabled SQL Explorer and Audit for the source database, disable it after the stress test completes.