All Products
Search
Document Center

Performance Testing:Load modes

Last Updated:Nov 01, 2024

Performance Testing Service (PTS) supports two load modes: virtual user (VU) mode and requests per second (RPS) mode. This topic describes the two load modes. You can select a load mode based on your business requirements.

VU mode

In VU mode, the load refers to the number of virtual users, which is the number of concurrent online users.

  • Scenarios

    If you want to assess how many concurrent online users each node of a business system can handle, you can use the VU load mode to specify the number of virtual users.

  • Usage

    • In VU mode, you need to specify the maximum number of virtual users for the entire scenario and set the virtual user weight for each business session.

    • APIs in a session have different response times. The number of virtual users that interact with each API also varies. A faster response time means that users can quickly complete their requests and fewer users wait at the API.

      For example, 100 virtual users perform a transaction on a business session that involves two APIs: API 1 and API 2. If API 1 has a fast response speed and API 2 has a slow response speed, more virtual users wait at API 2, which requires more thread resources to handle virtual user requests.

RPS mode

In RPS mode, the load refers to the number of requests per second.

  • Scenarios

    The RPS mode allows you to use RPS as a metric to measure the number of requests that a system can handle in a second.

  • Usage

    • Transactions per second (TPS) is a metric that measures how many transactions a system can handle in a second. In RPS mode, you can set RPS based on the TPS. If you want to test whether the throughput of a system can reach 500 TPS, set RPS to 500.

    • In RPS mode, if requests cannot be processed in a timely manner, a high number of virtual users may be generated. If an exception occurs, stop testing.

    • In RPS mode, the load cannot be automatically increased. You must manually adjust the load during testing. For more information, see Adjust the number of concurrent users.

    • In a session, the RPS value of a subsequent API cannot exceed the RPS value of the previous API.

      This aligns with a funnel model in which user engagement typically decreases at each subsequent step in the process. For example, the user journey in an e-commerce platform can be represented as a sequence of actions: viewing the homepage, checking product details, adding items to a cart, placing an order, and making a payment. Each successive step in the user journey tends to have a decreasing number of users.

Configure load levels and parameters

After you select the VU load (stress) mode, you must set the Weight of Max VU and Starting Percentage parameters in the Load Level Configuration section.

image

Load parameters

Each API serves as a node in a business system. API processing capabilities determine the volume of requests they can efficiently handle. The VU mode and the RPS mode apply loads in different manners. Therefore, the load settings are different for the two modes.

Note

Regardless of the test mode that you select, the sum of the maximum VUs or RPS in each scenario cannot exceed the maximum VUs or RPS of the resource plan.

Parameter

Description

Weight of Max VU

The virtual user weight assigned to a session. For example, a scenario has two business sessions: business session 1, which is assigned a weight of 1, and business session 2, which is assigned a weight of 3. The virtual users assigned to business session 1 account for 25% of the total virtual users, and business session 2 accounts for 75% of the total.

In VU mode, you must set the Weight of Max VU and Starting Percentage parameters for each business session. The VU mode specifies the number of virtual users on the client side to test how many concurrent virtual users a system can handle. Sessions in a scenario have specific business and throughput ratios. Refer to these ratios to set the maximum number of virtual users and the starting number of virtual users.

Starting Percentage

The starting percentage of the business session. Default value: 10%.

Max RPS

The RPS mode tests the throughput of each API operation. Therefore, you must specify the Max RPS and Starting RPS for each API operation.

Starting RPS

The starting RPS of an API.

Batch Set

You can configure the settings in bulk in VU and RPS modes.

  1. Select all business sessions or APIs that you want to configure.

  2. Click Batch Settings in the upper-right corner. In the dialog box that appears, enter a value and click OK.