Create a stress testing scenario in Performance Testing Service (PTS) to simulate realistic user traffic and measure application performance under load. PTS is built on the Alibaba Cloud end-to-end stress testing platform and supports web applications and mini programs that communicate over HTTP or HTTPS. It is used across industries such as e-commerce, Internet of vehicles (IoV), multimedia, finance and insurance, logistics and express delivery, advertising and marketing, and social networking.
Scenario structure
A stress testing scenario is organized into three levels:
Scenario
├── Business session A (parallel) ── runs simultaneously ──>
│ ├── API 1 (serial)
│ ├── API 2
│ └── API 3
│
└── Business session B (parallel) ── runs simultaneously ──>
├── API 1 (serial)
└── API 2| Level | Description |
|---|---|
| Scenario | The top-level container. It holds one or more business sessions that run in parallel. |
| Business session | An ordered set of APIs that represents a single user workflow, similar to a transaction. APIs in a session run serially, in the order listed. |
| API | A single request that defines the target URL and request details for one step in the workflow. |
Example: Suppose you stress test an e-commerce site with two parallel business sessions:
| Business session | APIs (executed in order) |
|---|---|
| Browse product A | 1. View homepage |
| Purchase product B | 1. Log on to the site → 2. Browse product B → 3. Add product B to the shopping cart → 4. Submit the order |
During the test, both sessions run at the same time. Within each session, the APIs execute one after another in sequence.
Prerequisites
Before you begin, make sure you have:
An Alibaba Cloud account with PTS activated
The target application URL accessible from the internet (or from a VPC if using internal stress testing)
Create a scenario
Step 1: Open the scenario editor
Log on to the PTS console, choose , and then click PTS.
The Scenario Settings tab opens.
Step 2: Add APIs to a business session
On the Scenario Settings tab, click the Add API drop-down list and select an API type. PTS supports two API types:
Configure the API with the target URL, request method, headers, and body as needed.
Repeat to add more APIs. After you start the stress test, the APIs within a business session execute in sequence.
Clicking Add API without selecting a type adds an HTTP API by default.
Step 3 (optional): Add more business sessions
Click Add Business Session to create additional business sessions. Each session runs in parallel during the stress test, simulating multiple concurrent user workflows.
Step 4 (optional): Add instructions
Add instructions to control stress testing behavior within a business session, such as conditions and loops. For details, see Instructions.
Step 5: Configure load settings
Configure the remaining sections on the Scenario Settings tab:
| Section | Description | Reference |
|---|---|---|
| Stress Mode Configuration | Define how load is applied (for example, VU Mode or RPS Mode). | Configure the load mode and load level |
| Load Level Configuration | Set the magnitude of load, such as the maximum number of virtual users (VUs) or target RPS (Requests Per Second). | Configure the load mode and load level |
| Advanced Settings | Configure additional parameters. | Advanced settings |
| End-to-End Monitoring | Integrate with ARMS and Managed Service for Prometheus to observe metrics and analyze performance bottlenecks during the test. | Configure end-to-end monitoring |
| Others | Configure miscellaneous settings. | -- |
Step 6: Debug or start the test
Choose one of the following actions at the bottom of the Scenario Settings tab:
Debug the scenario -- Click Debug in the lower-left corner to run a low-volume test and verify that your scenario is configured correctly. For details, see Debug a scenario.
Start the test -- Click Save and Start in the lower-left corner to save the scenario and immediately begin the stress test.
Example scenarios
Explore these example scenarios to see PTS stress testing in action:
Manage scenarios after creation
After you create a scenario, find it on the Scenarios page by selecting the PTS filter.
Use the Actions column to manage your scenario:
| Action | Description |
|---|---|
| Start | Run the stress test. See Start a stress test. |
| Edit | Open the Edit Scenario page to modify the scenario. PTS provides features such as scenario replication, business session validation and invalidation, and API replication to improve orchestration efficiency. See Manage a scenario. |
| Duplicate | Duplicate the scenario to use as a starting point for a new test. See Copy a scenario. |
| Delete | Remove the scenario. Stress test reports generated from the scenario remain available after deletion. |