All Products
Search
Document Center

Performance Testing:Create a PTS-based stress testing scenario

Last Updated:Nov 01, 2024

This topic provides the basic information about Performance Testing Service (PTS)-based stress testing scenarios. This topic also describes how to create a PTS-based stress testing scenario.

Background information

PTS is a stress testing tool that is developed based on the end-to-end stress testing platform of Alibaba Cloud. PTS-based stress testing is widely used for applications such as web applications and mini programs that communicate by using HTTP or HTTPS. PTS-based stress testing is applicable in various industries, such as e-commerce, Internet of vehicles (IoV), multimedia, finance and insurance, logistics and express delivery, advertising and marketing, and social networking. PTS-based stress testing can simulate real business scenarios that involve a large number of users and provides a comprehensive method to verify the website performance, capacity, and stability.

What is a stress testing scenario?

To initiate a stress test, you must create a stress testing scenario. A stress testing scenario contains one or more parallel tasks. Each task is equivalent to a business session and contains one or more serial APIs.

  • APIs are required for stress testing. APIs define the URL at each stage of a session. An API simulates a specific request to an application. For example, when you perform an operation on an e-commerce website, such as logging on, querying product details, or placing an order, multiple APIs are required to complete the operation.

  • A business session is an ordered set that consists of stress testing APIs with business meanings, which are similar to transactions.

The following example describes the relationship between a business session and an API.

You perform a stress test in which two tasks or business sessions are executed at the same time for Taobao.

  • Task A: Browse Product A.

  • Task B: Purchase Product B.

Task B contains four APIs that must be initiated in sequence. The following list describes the APIs:

  • Request 1: Log on to Taobao.

  • Request 2: Browse Product B.

  • Request 3: Add Product B to the shopping cart.

  • Request 4: Submit the order.

Procedure

  1. Log on to the PTS console, choose Performance Test > Create Scenario, and then click PTS.

  2. On the Scenario Settings tab, click the Add API drop-down list to add multiple APIs to a business session. After you initiate a stress test, the APIs are initiated in sequence. For more information, see HTTP APIs or JDBC APIs.

    Note

    If you click Add API, the system automatically adds an HTTP API.

  3. Optional. Click Add Business Session to add multiple business sessions. After you initiate a stress test, requests for the added business sessions are initiated at the same time.

  4. Optional. Use instructions to manage the stress testing behaviors in a business session. For more information, see Instructions.

  5. Configure other parameters.

    • Configure the parameters in the Stress Mode Configuration and Load Level Configuration sections. For more information, see Configure the load mode and load level.

    • Configure the parameters in the Advanced Settings section. For more information, see Advanced settings.

    • Configure the parameters in the End-to-End Monitoring section. For more information, see Configure end-to-end monitoring.

    • Configure the parameters in the Others section.

  6. Perform the following operations based on your business requirements:

    • Debug a scenario: On the Scenario Settings tab, click Debug in the lower-left corner. For more information, see Debug a scenario.

    • Initiate the test: On the Scenario Settings tab, click Save and Start Testing in the lower-left corner.

Examples

You can initiate a PTS-based stress test in the PTS console only with a few clicks. This section provides example scenarios for PTS-based stress testing.

What to do next

On the Scenarios page, select PTS to view the PTS-based stress testing scenario that you create.

Perform the following operations in the Actions column of the scenario:

  • Click Start to initiate the test. For more information, see Start a stress test.

  • Click Edit to go to the Edit Scenario page to modify scenario information. PTS provides a variety of features to improve orchestration efficiency, including scenario replication, validation and invalidation of business sessions, and API replication. For more information, see Manage a scenario.

  • Click Delete to delete a stress testing scenario. After the scenario is deleted, you can still view the generated stress test report.

  • Click Copy to copy a scenario. For more information, see Copy a scenario.