All Products
Search
Document Center

Platform For AI:CreateBenchmarkTask

Last Updated:Aug 28, 2026

Creates a stress testing task.

Try it now

Try this API in OpenAPI Explorer, no manual signing needed. Successful calls auto-generate SDK code matching your parameters. Download it with built-in credential security for local usage.

Test

RAM authorization

The table below describes the authorization required to call this API. You can define it in a Resource Access Management (RAM) policy. The table's columns are detailed below:

  • Action: The actions can be used in the Action element of RAM permission policy statements to grant permissions to perform the operation.

  • API: The API that you can call to perform the action.

  • Access level: The predefined level of access granted for each API. Valid values: create, list, get, update, and delete.

  • Resource type: The type of the resource that supports authorization to perform the action. It indicates if the action supports resource-level permission. The specified resource must be compatible with the action. Otherwise, the policy will be ineffective.

    • For APIs with resource-level permissions, required resource types are marked with an asterisk (*). Specify the corresponding Alibaba Cloud Resource Name (ARN) in the Resource element of the policy.

    • For APIs without resource-level permissions, it is shown as All Resources. Use an asterisk (*) in the Resource element of the policy.

  • Condition key: The condition keys defined by the service. The key allows for granular control, applying to either actions alone or actions associated with specific resources. In addition to service-specific condition keys, Alibaba Cloud provides a set of common condition keys applicable across all RAM-supported services.

  • Dependent action: The dependent actions required to run the action. To complete the action, the RAM user or the RAM role must have the permissions to perform all dependent actions.

Action

Access level

Resource type

Condition key

Dependent action

eas:CreateBenchmarkTask

*BenchmarkTask

acs:eas:{#regionId}:{#accountId}:benchmarktask/*

None None

Request syntax

POST /api/v2/benchmark-tasks HTTP/1.1

Request parameters

Parameter

Type

Required

Description

Example

body

string

No

The request body that contains the configuration parameters for the stress testing task.

{ "base": { "duration": 600 }, "service": { "serviceName": "test_service", "requestToken": "test_token" }, "data": { "path": "https://larec-benchmark-cd.oss-cn-chengdu.aliyuncs.com/youbei/sv_dbmtl/data/youbei.warmup.tf.bin", "dataType": "binary" }, "optional": { "maxRt": 100 } }

Parameters that are set to create a stress testing task

The following table describes the parameters for creating a stress testing task with eas-benchmark.

Parameter Description
base Basic configurations for the stress testing task.
service Configuration for the service to test.
data Configuration for the stress testing request data.
http HTTP request configuration for the service.
optional Optional advanced configurations for the stress testing task.

Table 1. Fields in the base parameter

Field Description
name The name of the stress testing task. If not specified, the task is automatically named after the service. Optional.
duration The stress testing duration. Unit: seconds. Default value: 1200. Optional.
qps The expected queries per second (QPS). Default value: 10000. Optional.
concurrency The number of concurrent connections per instance. Default value: 40. The value can be automatically adjusted. Optional.
agentCount The number of instances for the stress testing task. Default value: 1. The value can be automatically adjusted. Optional.

Table 2. Fields in the service parameter

**Field** **Description**
serviceUrl The URL of the service to test. Not required for Elastic Algorithm Service (EAS) services. Optional.
serviceName The name of the service to test. Required for EAS services. Not required for custom services. Optional.
requestToken The token used to access the service. Not required if **serviceName** is specified. Optional.
endpointType The stress testing type. Valid values: **default** (test through a gateway) and **direct** (test the service directly). Default value: **direct**. Optional.

Table 3. Fields in the data parameter

**Field** **Description**
content The content of a stress testing request. Value type: STRING. Optional.
path The path of the stress testing data. Supports a single file or a `.zip` file, which is automatically downloaded and decompressed. Optional.
dataType The test data type. Valid values: text and binary. Default value: text. Optional.
multiLine Specifies whether to parse the stress testing data line by line. Valid values: true and false. Default value: false. Optional.

Table 4. Fields in the HTTP parameter

**Field** **Description**
method The HTTP request method. Default value: POST. Optional.
host The request host. Empty by default. Optional.
headers The HTTP request headers. Value type: LIST, for example, `["Authorization:aaa", "Content-Type:text"]`. Optional.
timeout The HTTP request timeout. Unit: milliseconds. Default value: 20000. Optional.

Table 5. Fields in the optional parameter

**Field** **Description**
mode The stress testing mode. Valid values: auto, scan (periodically perform stress testing), and manual. Default value: auto. Optional.
adjustInterval The interval at which stress testing is automatically performed. Unit: seconds. Default value: 60. Optional.
minQPS The minimum QPS. Default value: 100. Optional.
maxQPS The maximum QPS. Default value: 10000. Optional.
maxRT The maximum response time. If the actual response time exceeds this limit, the QPS is automatically reduced until the response time drops below the limit. Optional.
qpsGrowthDelta The QPS increment. Default value: 50. Optional.
faultTolerate The maximum tolerable request error rate, excluding HTTP 200 errors. Default value: 0.001. Optional.
faultAction The action to take when the error rate exceeds the faultTolerate threshold. Valid values: stop (maintain the current QPS) and revise (dynamically adjust the QPS until the error rate meets expectations). Optional.

Response elements

Element

Type

Description

Example

object

The response parameters.

RequestId

string

The request ID.

40325405-579C-4D82********

TaskName

string

The name of the stress testing task.

benchmark-larec-test-1076

Region

string

The region ID where the stress testing task runs.

cn-shanghai

Message

string

The returned message.

Benchmark task [foo] is Creating

Examples

Success response

JSON format

{
  "RequestId": "40325405-579C-4D82********",
  "TaskName": "benchmark-larec-test-1076",
  "Region": "cn-shanghai",
  "Message": "Benchmark  task [foo] is Creating"
}

Error codes

See Error Codes for a complete list.

Release notes

See Release Notes for a complete list.