Server concurrency estimation formula and calculation method

Server concurrency estimation formula and calculation method

Recently, I need to stress test the server again. Here I will summarize the estimation schemes and estimation methods I have learned recently. The following estimation method does not take into account extreme situations such as flash sales.

Concurrency value estimation

1.1 Classical formula

Generally speaking, the following empirical formula is used to estimate the average number of concurrent users and peak data of the system:

  • 1) The average number of concurrent users is C = nL/T
  • 2) Peak number of concurrent users C' = C + 3*square root C

C is the average number of concurrent users, n is the number of login sessions, L is the average length of a login session, and T is the length of time to be observed.

C' is the peak number of concurrent users

If we use this formula to calculate the approximate range of concurrent users for a takeaway ordering app with 1 million concurrent users, we can get:

Assume that a food delivery app has 1 million users, and daily active users account for 12.5%, or 125,000 daily active users. The average time from opening the app to ordering food for each daily active user is about 5 minutes, and assume that there are users using the app from 8 a.m. to 12 p.m. Then a value can be calculated:

Average number of concurrent users C = 125000*5/16*60 = 651
Peak number of concurrent users C`=651+3*root 651=726

The above is the number of concurrent users calculated by the classic formula, but it may appear different from the actual situation.

As for food delivery apps, most people will order food during peak hours, so this type of food delivery app should be considered separately.

We use the 2/8 principle to estimate the number of concurrent users, that is, 80% of users will order food during the peak period, and the peak period is set at 11-12 and 17-19 o'clock, a total of 5 hours. In this case, the number of concurrent users is estimated as follows:

Average number of concurrent users C = 125000 * 5 * 0.8 / 5 * 60 = 1666
Peak number of concurrent users C`=1666+3*square root of 1666=1788

1.2 General formula

For most scenarios, you can use (total number of users/statistical time) * impact factor (usually 3) to estimate the concurrency.

For example, taking the subway as an example, there are 50,000 passengers every day. The morning peak is from 7 to 9 o'clock every day, and the evening peak is from 6 to 7 o'clock. According to the 8/2 principle, 80% of the passengers will take the subway during peak hours. The number of people arriving at the subway ticket gate per second is 5000080%/(36060)=3.7, about 4 people/S. Taking into account factors such as security checks and entrance closures, the actual number of people accumulated at the ticket gate must be larger than this. Assuming that each person needs 3 seconds to enter the station, the actual concurrency should be 4 people/s3s=12. Of course, the impact factor can be increased according to actual conditions!

Therefore, IoT devices can actually be considered as general-purpose devices.

In a more extreme case, 95% of the 1 million devices are daily active devices, or 950,000. And assuming that 80% of these devices will access the server within 3 hours (peak period), the number of concurrent devices can be estimated.

950000*0.8/(3*60*60)=70/s

Due to the high uncertainty of IoT devices, we set the impact factor to 5

.70*5=350 means the number of active devices is 350 per second.

The above is the full content of this article. I hope it will be helpful for everyone’s study. I also hope that everyone will support 123WORDPRESS.COM.

You may also be interested in:
  • Server stress testing concepts and methods (TPS/concurrency)
  • Server concurrency estimation formula and calculation method

<<:  CSS animation combined with SVG to create energy flow effect

>>:  Sample code for implementing the history tag menu using vue+elementui+vuex+sessionStorage

Recommend

How to automatically number the results of MYSQL query data

Preface In fact, I have never encountered this ki...

Specific use of Linux man command

01. Command Overview Linux provides a rich help m...

CSS3 implementation example of rotating only the background image 180 degrees

1. Mental Journey When I was writing the cockpit ...

CSS3 flexible box flex to achieve three-column layout

As the title says: The height is known, the width...

How to improve Idea startup speed and solve Tomcat log garbled characters

Table of contents Preface Idea startup speed Tomc...

Error mysql Table 'performance_schema...Solution

The test environment is set up with a mariadb 5.7...

JS calculates the probability of winning based on the prize weight

Table of contents 1. Example scenario 1.1. Set th...

Detailed explanation of how to use WeChat mini program map

This article example shares the specific implemen...

Why developers must understand database locks in detail

1.Lock? 1.1 What is a lock? The real meaning of a...

JavaScript to implement the aircraft war game

This article shares with you how to use canvas an...

jQuery implements the mouse drag image function

This example uses jQuery to implement a mouse dra...

Dynamic starry sky background implemented with CSS3

Result:Implementation Code html <link href=...