In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-03-28 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >
Share
Shulou(Shulou.com)06/03 Report--
The number of concurrent users: refers to the users who operate the business in the real system, which is generally called the number of virtual users (Virutal User) in the performance testing tool.
The concept of the number of concurrent users is different from that of registered users and online users.
1. The number of concurrent users will certainly exert pressure on the server.
2. The number of online users is only "hanging" on the system, which does not exert pressure on the server.
3. The number of registered users generally refers to the number of users that exist in the database.
TPS:Transaction Per Second, transactions per second, is a very important indicator of system performance.
TPS is the number of transactions per second, but the transaction is based on the number of virtual users. If a virtual user completes a transaction in 1 second, then TPS is obviously 1. If the response time of a business is 1ms, then a user can complete 1000 transactions in 1 second, and TPS is 1000. If the response time of a business is 1s, then one user can only complete one transaction in one second, and at least 1000 users are needed to achieve 1000TPS. Therefore, it can be said that one user can generate 1000 TPS and 1000 users can also generate 1000TPS, depending on the response time.
In other words, when evaluating the performance of the server, we should combine TPS and the number of concurrent users, dominated by TPS, supplemented by the number of concurrent users to measure the performance of the system. If you have to measure by the number of concurrent users, you need a premise, that is, how long the transaction will be completed, because when the system load is not high, add the think time (the value of the think time is equal to the transaction response time) to the script, the number of concurrent users can basically be doubled, so it doesn't make much sense to use the number of concurrent users to measure the performance of the system.
In the performance testing, it is not necessary to use tens of thousands of users to test concurrently, if only to ensure that the system processing time is fast enough, hundreds of users or even dozens of users can achieve the goal. As far as he knows, many experts have done performance testing projects that basically do not have more than 5000 concurrent users. Therefore, for large systems, with very high traffic and enough hardware configuration, 5000 user concurrency is sufficient; for small and medium-sized systems, 1000 user concurrency is sufficient.
Several important parameters of system throughput: TPS, number of concurrency, response time
TPS: transactions per second
Concurrency: the number of transactions processed by the system at the same time
Response time: generally take the average response time
Number of TPS= concurrent users / (response time + Thinktime)
How do concurrent users calculate
1. Classical formula 1:
In general, 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 * root C
C is the average number of concurrent users, n is the number of login session, L is the average length of login session, and T is the length of time for value inspection.
C'is the peak number of concurrent users.
For example, suppose system A, which has 3000 users, has an average of about 400 users per day (available from system logs). For a typical user, the average time from login to logout is 4 hours in a day, while in a day, users will use the system only within 8 hours.
that,
The average number of concurrent users is: C = 400 million 4 Universe 8 = 200
The peak number of concurrent users is: C'= 200 + 3* root 200 = 243
For example, a company has designed a compensation system for its 170000 employees, in which employees can enter the system to query their salary information, but not everyone will use the system, assuming that only 50% of them will change the system on a regular basis. 70% of these people use the system once in the last week of each month, and the average time to use the system is 5 minutes.
The average number of concurrent users in the last week of the month is (from 9 to 5):
N = 170000cm 0.5000.7max 5 = 11900
C = 11900pm 5max 60ax 8 = 124
The throughput is calculated as: F = Vu * R / T unit is unit / s
F is the transaction throughput, Vu is the number of virtual users, R is the number of requests made by each virtual user, and T is the time spent processing these requests
General Formula 2:
For most scenarios, we use (total number of users / statistical time) * impact factor (usually 3) to estimate the concurrency.
For example, taking the subway as an example, the daily number of passengers is 50,000, 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 principle of 8x2, 80% of the passengers will take the subway during the rush hour, then the number of people arriving at the subway ticket gate per second is 50000080% / (360060) = 3.7, about 4 people / S, taking into account the security check, entrance closure and other factors. The actual number of people accumulating 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 / s*3s=12. Of course, the influence factor can be increased according to the actual situation!
3. According to the PV formula:
For example, for a website, the daily PV is about 1000W. According to the principle of 2 pv and 8, we can think that 80% of the 1000W pv is completed within 9 hours of the day (people's energy is limited), then the TPS is:
1000w*80%/ (90003600) = 246.92 / s, if you take the experience factor 3, the concurrency should be:
246.92, 337, 740
4. According to TPS estimates:
The formula is C = (Think time + 1) * TPS
Fifth, according to the number of users of the system:
Concurrent users = 8% to 12% of the maximum number of online users in the system
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.