Estimation of the number of concurrent users for performance testing

Before calculating the number of concurrent users, you need to understand two concepts.

Concurrent users : Refers to users who operate business at the same time in the real system, and are generally called virtual users in performance testing tools. Concurrent users The biggest feature of these users is that they interact with the server. This interaction can be one-way data transmission or two-way data transmission.

TPS : the number of transactions per second, the number of transactions or transactions that the system can handle per second, and the number of transactions per second is an important indicator to measure system performance.

In the process of performance testing, it is not the case that the more concurrent users are initiated, the better the performance will be if the system can support it. Calculating the number of concurrent users needs to be considered in conjunction with TPS. The relationship between the two is that transactions are generated by virtual users. If a virtual user completes a transaction within 1 second, then TPS is 1. At least 1,000 users are required to achieve 1,000 TPS; if If the response time of a certain business is 1 millisecond, then a user can complete 1000 transactions within 1 second, and the TPS is 1000. Therefore, 1 user can generate 1000TPS, and 1000 users can also generate 1000TPS, mainly depending on the speed of the response time. Performance testing requires a set of standardized processes and testing strategies. If a large number of users are pressurized at one time without sufficient evaluation, the system will have a high failure rate and a long response time, and the final test results will not be very meaningful.

Methods for estimating the number of concurrent users:

Formula 1:

Average number of concurrent users: C = nL/T

The peak number of concurrent users: C'= C+3 root C

C is the average number of concurrent users; n is the number of login sessions; L is the average length of login sessions; T refers to the length of the time period under investigation.

example

There are 3,000 users in a system, and about 400 users access the system every day on average. For a typical user, the average time from logging in to logging out of the system within a day is 4 hours. In a day, users Use the system only within 8 hours.

C = 400*4/8 = 200

C'= 200+3*square root 200 = 242

Formula 2

Average number of concurrent users: C=n/10

Peak number of concurrent users: C'=r*C (usually r=2~3)

Usually use 10% of the maximum number of users accessing the system as the average number of concurrent users

formula 3

According to TPS estimation: the formula is C = (Think time + 1)*TPS

formula 4

Calculated based on the number of system users: number of concurrent users = 8% to 12% of the maximum number of online users in the system

Practical case

Optical theory is useless, you have to learn to follow along, and you have to do it yourself, so that you can apply what you have learned to practice. At this time, you can learn from some practical cases.

If it is helpful to you, please like and collect it to give the author an encouragement. It is also convenient for you to quickly find it next time.

If you don’t understand, please consult the small card below. The blogger also hopes to learn and progress with like-minded testers

At the right age, choose the right position, and try to give full play to your own advantages.

My road of automated test development is inseparable from the plan of each stage along the way, because I like planning and summarizing,

Test and develop video tutorials, study notes and receive portals! ! !

Guess you like

Origin blog.csdn.net/m0_59868866/article/details/131947205