[Performance Test] Basic Knowledge - Stress Model

picture

common stress patterns

Concurrent mode (i.e. virtual user mode) and RPS mode (i.e. Requests Per Second, requests per second, throughput mode).

This article introduces the difference between these two pressure modes, so that you can choose a more suitable pressure mode according to your own business scenarios.

concurrent mode

"Concurrent" refers to the number of virtual concurrent users. From a business perspective, it can also be understood as the number of concurrent online users.

Application Scenario

If you need to find out the number of online users that each node of the business system can carry at the same time from the perspective of the client, you can use this mode to set the target concurrency.

Instructions for use

In concurrent mode, you need to specify the maximum number of concurrency in the whole scene, and then set the concurrency weight of each serial link.

The response speed of each API in the serial link is different (response time is different), so the number of concurrent APIs per unit time will also be different. The faster the API response speed, the fewer the number of concurrent users accumulated on the API per unit time.

Assume that there are currently 100 virtual users who need to operate a certain transaction (that is, a serial link). There are 2 APIs in this serial link, API 1 responds fast and API 2 responds slowly. Then more virtual users will wait on API 2, and API 2 needs more thread resources to process more virtual user requests.

RPS mode

RPS (Requests Per Second) refers to the number of requests per second.

Application Scenario

The RPS mode is the throughput mode. By setting the number of requests sent per second, from the perspective of the server, the throughput capacity of the system can be directly measured, eliminating the cumbersome conversion from concurrency to RPS, and can quickly implement pressure testing.

Instructions for use

API interfaces (such as adding shopping carts to e-commerce, placing orders, etc.) mainly use TPS (Transaction Per Second, transactions per second) to measure the throughput of the system. If you choose this mode, you can directly set the RPS according to the expected TPS. If you want to check whether the "order" interface can meet the expectation of 500 TPS, then set the RPS to 500 and send 500 requests per second to check the throughput of the system.

In this mode, if the request cannot be responded in time, it may lead to high concurrency. Please stop in time if there is an abnormality.

This mode only supports pressure testing with non-automatic increment, that is, you need to manually adjust the speed during the pressure testing process. For details, see Speed ​​Adjustment in Manual Speed ​​Adjustment Mode.

In the same link, the RPS value of the latter API must be less than or equal to the RPS value of the former API.

Based on actual business considerations, the general normal business link conversion model should be in the shape of a funnel. For example, the normal business link is: view the home page - view product details - add to shopping cart - place an order - pay. Under normal circumstances, the number of users who view the homepage will be more than the number of users who view product details, and the number of users who view product details will be more than the number of users who add to the shopping cart, and so on, so the RPS value of the latter API must be less than The value of the previous API, which is more in line with the funnel model.

Configuration level and data

After setting the pressure measurement mode, you also need to set the pressure measurement start level and maximum level on the pressure configuration page.

Pressure measurement value

Each API can be regarded as a node of the business system, and different processing capabilities lead to inconsistent business volumes. Concurrent mode and RPS mode apply pressure differently, so the settings for pressure measurement values ​​will also be different.

Note No matter which stress test mode is selected, the sum of the maximum value of each scenario cannot exceed the maximum VU and RPS of the corresponding resource package under the account.

The difference between the two models

RPS (Requests Per Second) pressure model and concurrent user model are commonly used models in performance testing, but their testing methods and indicators are slightly different.

The concurrent user model is a test method that simulates multiple concurrent users accessing the system at the same time to test the performance of the system under high concurrency conditions. Testers can gradually increase the number of concurrent users until the bottleneck of the system is reached. In the concurrent user model, the main indicators of concern are the number of concurrent users, response time, throughput, error rate, etc.

The RPS pressure model is also a test method, which simulates multiple concurrent users sending requests to the system to test the performance of the system under high concurrency conditions. Testers can gradually increase the amount of requests until the bottleneck of the system is reached. In the RPS pressure model, the main indicators of concern are the number of requests processed per second (ie RPS), response time, throughput, error rate, etc.

Therefore, the difference between the two models is that for the same number of concurrent users, the RPS model may generate more requests, while the concurrent user model places more emphasis on the concurrent requests of each user. In addition, the two models have slightly different concerns about the performance of the test system, but they both test the performance of the system under high concurrency conditions in order to find system bottlenecks and optimize them.

Finally: The complete software testing video learning tutorial below has been sorted out and uploaded. Friends can get these For [software testing] friends, it should be the most comprehensive and complete preparation warehouse. This warehouse is also Accompany tens of thousands of test engineers to go through the most difficult journey, and hope to help you too!【保证100%免费】
insert image description here

软件测试技术交流群社:746506216(里面还有工作内推机会,毕竟我们是关系社会。)

Software Testing Interview Documentation

We must study to find a high-paying job. The following interview questions are the latest interview materials from first-tier Internet companies such as Ali, Tencent, and Byte, and some Byte bosses have given authoritative answers. Finish this set The interview materials believe that everyone can find a satisfactory job.

insert image description here

How to obtain interview documents:


insert image description here

Guess you like

Origin blog.csdn.net/AI_Green/article/details/130090669