Pressure models

更新时间:
复制 MD 格式

Performance Testing Service (PTS) supports two pressure models: concurrency mode and RPS mode. Concurrency mode is also known as virtual user mode, and RPS mode (requests per second) is also known as throughput mode. This topic explains the differences between these models to help you select the most suitable model for your use case.

Concurrency mode

Concurrency represents the number of virtual concurrent users, which simulates users simultaneously interacting with your application.

Use cases

To determine the number of simultaneous users your application can handle from a client-side perspective, use this mode to set a target concurrency.

Usage notes

  • In concurrency mode, you specify the maximum concurrency for the entire test scenario and then set the concurrency weight for each serial link.
  • Because APIs within a serial link have different response times, the concurrency on each API at any given moment also varies. The faster an API responds, the fewer virtual concurrent users accumulate on that API.

    For example, imagine 100 virtual users are executing a transaction that is modeled as a serial link. This serial link contains two APIs: API 1, which responds quickly, and API 2, which responds slowly. In this case, more virtual users will accumulate at API 2, requiring more thread resources to handle the increased number of requests.

RPS mode

RPS stands for requests per second.

Use cases

RPS mode, also known as throughput mode, lets you directly measure your system's throughput from a server-side perspective. By setting a target number of requests per second, you can quickly run a stress test without the complex conversion from concurrency to RPS.

Usage notes

  • The throughput of API endpoints, such as adding an item to a shopping cart or placing an order, is often measured in transactions per second (TPS). You can use RPS mode to directly set a target RPS that corresponds to your expected TPS. For example, to verify if an order placement API can handle 500 TPS, you can set the RPS to 500 to test the system's throughput.
  • In this mode, if requests are not processed quickly enough, high concurrency can build up. If you observe abnormal behavior, stop the test immediately.
  • This mode supports only manual load adjustments during a stress test, not automatic ramping. For more information, see Adjust the load manually.
  • Within the same serial link, the RPS value of a subsequent API must be less than or equal to the RPS value of the preceding API.

    This requirement reflects a typical user journey, which often resembles a funnel. For example, consider a common e-commerce workflow: View Homepage > View Product Details > Add to Cart > Place Order > Make Payment. Typically, more users view the homepage than view product details. The number of users then decreases for subsequent actions, such as adding an item to the cart, and so on. Therefore, setting a lower RPS for each subsequent API aligns the test with this funnel model of user behavior.

Configure load levels and values

After you select a pressure model, you must configure the initial and maximum load levels on the stress configuration page.

量级

Stress test values

Each API is a node in your application, and each node has a different processing capacity. Because concurrency mode and RPS mode apply load differently, their configuration values also differ.

Note Regardless of the pressure model you choose, the sum of the maximum values across all scenarios cannot exceed the maximum VU or RPS limits of your resource pack.
ParameterDescription
maximum concurrency weightThe weight of this serial link relative to the entire scenario. For example, if serial link 1 has a weight of 1 and serial link 2 has a weight of 3, they are allocated 25% and 75% of the total maximum concurrency, respectively.

In concurrency mode, set the maximum concurrency weight and initial percentage at the serial link level. Concurrency mode assesses the system's capacity for concurrent users from a client business perspective. However, the multiple serial links (transactions) within a scenario typically have specific business ratios and actual throughput relationships. For example, based on business evaluation, the ratio of placing an order to adding an item to the cart is 1:0.8. Therefore, you only need to configure the maximum and initial concurrency at the serial link (transaction) level according to these ratios.

initial percentageThe initial load percentage for this serial link. The default is 10%.
maximum RPSmaximum RPSInitial RPSThe maximum number of requests per second (RPS) to target for a specific API.
initial RPSThe initial RPS for a single API.
batch settingsLets you apply the same configuration to multiple serial links or APIs at once.
  1. Select all the serial links or APIs you want to configure.
  2. On the right, click batch settings. In the dialog box that appears, enter a value and click Confirm.