Creates stress testing tasks.

Database Autonomy Service (DAS) provides the intelligent stress testing feature. This feature checks whether your instance specifications need to be scaled up to efficiently handle workloads during peak hours. For more information, see Intelligent stress testing. Before you call this API operation, make sure that your database instances meet the following conditions:

  • The source instance must be an ApsaraDB RDS for MySQL instance of High-availability Edition or Enterprise Edition or a PolarDB for MySQL instance of Cluster Edition or Archive Database.
  • The destination instance must be an ApsaraDB RDS for MySQL instance or a PolarDB for MySQL instance.
  • The source and destination instances must be connected to DAS. For more information, see Access an Alibaba Cloud database instance.
  • DAS Professional Edition must be activated for the source and destination instances. For more information, see DAS Professional Edition.

Request parameters

Parameter Type Required Example Description
Action String Yes CreateCloudBenchTasks

The operation that you want to perform. Set the value to CreateCloudBenchTasks.

TaskType String Yes pressure test

The type of the stress testing task. Valid values:

  • pressure test: A task of this type replays traffic captured from the source instance on the destination instance at the maximum playback rate supported by the destination instance. This is the default value.
  • smart pressure test: A task of this type analyzes traffic captured from the source instance over a short period of time and generates traffic on the destination instance for continuous stress testing. The business model based on which the traffic is generated on the destination instance and the traffic distribution are basically consistent with those on the source instance. Stress testing tasks of this type help you reduce the amount of time consumed to collect data from the source instance and decrease storage costs and performance overheads.
SrcInstanceId String Yes rm-2ze1jdv45i7l6****

The ID of the source instance. The instance must be an ApsaraDB RDS for MySQL instance or a PolarDB for MySQL instance. You can call the GetInstanceInspections operation to query the ID.

Note If you set DstType to Instance, this parameter must be specified.
Description String Yes test-das-bench-0501

The description of the stress testing task.

SrcPublicIp String No None

A hidden parameter.

DstInstanceId String No rm-2ze1jdv45i7l6****

The ID of the destination instance. The instance must be an ApsaraDB RDS for MySQL instance or a PolarDB for MySQL instance. You can call the GetInstanceInspections operation to query the ID.

Note If you set DstType to Instance, this parameter must be specified.
GatewayVpcId String No vpc-t4nsnwvpbc1h76ja4****

The ID of the virtual private cloud (VPC) in which the database gateway (DBGateway) is deployed.

Note If you set ClientType to ECS, this parameter must be specified.
GatewayVpcIp String No 172.30.29.246

The IP address or domain name of the DBGateway.

Note If you set ClientType to ECS, this parameter must be specified.
ClientType String Yes ECS

The type of the stress testing client. Valid values:

  • ECS: If you set this parameter to ECS, you must prepare the DBGateway.
  • DAS_ECS: If you set this parameter to DAS_ECS, DAS automatically purchases and deploys an Elastic Compute Service (ECS) instance for stress testing.
RequestStartTime String No 1608888296000

The start time of the stress testing task. Specify the time in the UNIX timestamp format. Unit: milliseconds.

RequestEndTime String No 1608888296001

The end time of the stress testing task. Specify the time in the UNIX timestamp format. Unit: milliseconds.

RequestDuration String No 86400000

The duration of the stress testing task for which traffic is captured from the source instance. Unit: milliseconds.

Rate String No 1

The rate at which the traffic captured from the source instance is replayed on the destination instance. The value must be a positive integer. Valid values: 1 to 30. Default value: 1.

SmartPressureTime String No 86400

The duration of the stress testing task for which the traffic is generated on the destination instance.

Note If you set TaskType to smart pressure test, this parameter must be specified.
DtsJobClass String No medium

The specification of the Data Transmission Service (DTS) migration task. You can call the DescribeCloudbenchTask operation to query the specification.

Note When you start a stress testing task, the basic data of the source instance is first migrated to the destination instance. When you create a DTS migration task, this parameter must be specified.
DtsJobId String No 23127

The ID of the DTS migration task. You can call the ConfigureDtsJob operation to query the ID.

Note If a DTS migration task already exists in the DTS console, this parameter must be specified.
SrcSuperAccount String No admin

The name of the privileged account for the source instance. Set the value to admin.

Note If you set DstType to Instance, this parameter must be specified.
SrcSuperPassword String No admin1234

The password of the privileged account for the source instance.

Note If you set DstType to Instance, this parameter must be specified.
DstSuperAccount String No root

The name of the privileged account for the destination instance.

DstSuperPassword String No root1234

The password of the privileged account for the destination instance.

DstType String No Instance

The type of the identifier that is used to specify the destination instance. Valid values:

  • Instance: the ID of the instance. This is the default value.
  • ConnectionString: the URL of the instance.
DstConnectionString String No rm-de21209****.mysql.rds.aliyuncs.com

The URL of the destination instance. The specified URL must be the URL of an ApsaraDB RDS for MySQL instance or a PolarDB for MySQL instance.

Note This parameter takes effect only when the DstType parameter is set to ConnectionString. Otherwise, this parameter is ignored.
DstPort String No 3306

The port number of the destination instance.

Note This parameter takes effect only when the DstType parameter is set to ConnectionString. Otherwise, this parameter is ignored.
WorkDir String No /tmp/bench/

The path of the temporary directory that is generated for stress testing.

BackupId String No 229132

The ID of the backup set. You can call the DescribeBackups operation to query the ID.

BackupTime String No 2021-04-23'T'13:22'14'

The time when the backup starts. Specify the time in the yyyy-MM-ddTHH:mm:ssZ format. The time must be in UTC.

Amount String No 1

The number of stress testing tasks to create. The value must be a positive integer. Valid values: 1 to 30. Default value: 1.

EndState String No WAIT_TARGET

The status that specifies the last operation performed for the stress testing task. Valid values:

  • WAIT_TARGET: prepares the destination instance
  • WAIT_DBGATEWAY: prepares the DBGateway
  • WAIT_SQL: prepares the full SQL statistics
  • WAIT_LOGIC: prepares to replay the traffic
Note When the status of a stress testing task changes to the state specified by the EndState parameter, the stress testing task becomes completed.

Response parameters

Parameter Type Example Description
Code String 200

The returned status code.

Message String Successful

The message returned for the request.

Note If the request is successful, Successful is returned. If the request fails, an error message such as an error code is returned.
RequestId String B6D17591-B48B-4D31-9CD6-9B9796B2****

The ID of the request.

Success String true

Indicates whether the request is successful. Valid values:

  • true: The request is successful.
  • false: The request failed.
Data Array of String "Data": { "total": 1, "list":[...] }, "Code": 200, "Success": true }

The detailed information, including the error codes and the number of error messages.

Examples

Sample requests

http(s)://das.cn-shanghai.aliyuncs.com/?Action=CreateCloudBenchTasks
&ConsoleContext=None
&TaskType=pressure test
&SrcInstanceId=rm-2ze1jdv45i7l6****
&Description=test-das-bench-0501
&SrcPublicIp=192.0.2.0
&DstInstanceId=rm-2ze1jdv45i7l6****
&GatewayVpcId=vpc-t4nsnwvpbc1h76ja4****
&GatewayVpcIp=172.30.29.246
&ClientType=ECS
&RequestStartTime=1608888296000
&RequestEndTime=1608888296001
&RequestDuration=86400000
&Rate=1
&SmartPressureTime=86400
&DtsJobClass=medium
&DtsJobId=23127
&SrcSuperAccount=admin
&SrcSuperPassword=admin1234
&DstSuperAccount=root
&DstSuperPassword=root1234
&DstType=Instance
&DstConnectionString=rm-de21209****.mysql.rds.aliyuncs.com
&DstPort=3306
&WorkDir=/tmp/bench/
&BackupId=229132
&BackupTime=2021-04-23'T'13:22'14'
&Amount=1
&EndState=WAIT_TARGET
&<Common request parameters>

Sample success responses

XML format

HTTP/1.1 200 OK
Content-Type:application/xml

<CreateCloudBenchTasksResponse>
    <Code>200</Code>
    <Message>Successful</Message>
    <RequestId>B6D17591-B48B-4D31-9CD6-9B9796B2****</RequestId>
    <Success>true</Success>
    <Data>"Data": { "total": 1, "list":[...] }, "Code": 200, "Success": true }</Data>
</CreateCloudBenchTasksResponse>

JSON format

HTTP/1.1 200 OK
Content-Type:application/json

{
  "Code" : "200",
  "Message" : "Successful",
  "RequestId" : "B6D17591-B48B-4D31-9CD6-9B9796B2****",
  "Success" : "true",
  "Data" : [ "\"Data\": { \"total\": 1, \"list\":[...] }, \"Code\": 200, \"Success\": true }" ]
}

Error codes

HttpCode Error code Error message Description
400 InvalidParams The request parameters are invalid. The error message returned because the specified request parameters are invalid.

For a list of error codes, visit the API Error Center.