Concurrent Volume Calculation Formulas

The basic concept of concurrency

Concurrent concepts:

  The number refers to the website accessible at the same time, the larger the number, the higher instantaneous bandwidth requirements.

Concurrent server volume is divided into:

  1. The service number of concurrent users; 2. Maximum number of concurrent access; 3. the number of system users; 4 concurrent users;    

Formulas used to estimate traffic concurrency of:

  C = nL / T

  C ^ = C +. 3 × (C square root)

  where: C is the average service number of concurrent users, n being login number of session, L is the login average length of the session, T refers to the length of the period of investigation, C ^ refers to the peak number of users concurrent services.

Examples of analysis

  Suppose there are 1000 users OA system, users send 400 a day visit, each logon to exit the average time of 2 hours, the system user only within 8 hours in a one day period. The average and maximum concurrent concurrency follows:

  C = 2 × 400/100. 8 =
  C ^ + = 100. 3 × (the square root of 100) = 100 + 3 × 10 = 130

  Also, if you know the average user requests from the number of u, the system throughput can be estimated as u × C.

Pressure server computing (reprint: https://www.cnblogs.com/ylcms/p/7738692.html )

  You want to build a sustainable PV 5 million daily website / do? 5 million PV What is the concept? Server to handle the number of requests per second to respond? If you calculate it? 

What is PV:
PV is shorthand for page view. PV is the number of pages visited, every open or refresh the page, even do a pv. 

Computing model: 
each server of the number of requests per second = ((80% * PV total amount) / (24 hours * 60 minutes * 60 seconds * 40%)) / number of servers.
The key parameter is 80%, 40%. 80% indicating a day of request occurs in 40% of the time of day. 40% 24 hours 9.6 hours 9.6 hours a day among 80% of requests occur (for Internet applications is, multiple requests during the day, at night request less). 

 

Results simple calculation:
((80% * 5,000,000) / (24 hours * 60 minutes * 60 seconds * 40%)) / 2 = 115.7 request / sec 
((80% * 1,000,000) / (24 hours * 60 minute * 60 seconds * 40%)) / 2 = 23.1 requests / second 

preliminary conclusion: 
now we are doing stress testing, there is a standard, if your server can handle 115.7 one second request, can withstand 5 million PV / day. If your server can handle 23.1 request one second, can withstand one million PV / day.

 

Leave enough margin:
The number of requests is more evenly distributed in 9.6 hours in the day, but the reality is not so evenly distributed, there will be peaks and troughs. In order to cope with peak periods, you should leave some leeway, but also at least double x2, x3 times too.
115.7 Request / sec * 2 times = 231.4 requests / sec
115.7 Request / s * 3 = 347.1 request times / sec
46.2 23.1 Request Request / s * = 2 times / sec
23.1 Request / s * 3 = 69.3 times the request / sec

 

final conclusion:
If your server can handle one second 231.4--347.1 requests / sec, we can cope with an average of 5 million PV / day.
If your server can handle one second 46.2--69.3 requests, we can deal with an average of 1 million PV / day.

 

Description:
N requests per second described herein, is QPS. Because I care about is the application's ability to handle traffic.

 

practical experience:
1, according to practical experience, the use of two rack-mounted servers conventional configuration, the configuration is common configuration, for example, a 4-core CPU + 4G + server SAS hard disk memory.

 

2, hard disk performance is important, by the database server. General server with 15,000 rpm SAS drives, senior point can be equipped with SSD hard disk performance will be better. Most most important indicator is the "random read and write performance" instead of "sequential read and write performance." (This example is the most common configuration of 15,000 rpm SAS hard drive, right)
3, a server running Tomcat running j2ee program, a server running MySql databases, programs written in the middle level (this is really bad quantify), is a forum for the type of application (always replies, the cache is not easy to do, can not Static).
4, under the above circumstances of hardware and software, can withstand one million PV / day. (Margin has been left to deal with a sudden access peak)

 

Note that the network bandwidth room:
Some people say I'm the above conditions are met, but the actual performance is to meet its target. Then please pay attention to your external network bandwidth, but bandwidth is cheap server in the country is very expensive, you are likely to share with you a 100M fiber in the engine room, practically every person can be divided into about 2M bandwidth. No matter how little 5M, 10M exclusive no matter how little two-room, which is already very expensive (Beijing price).
One day or traffic: 20k bytes per page * 1 million pages / 1024 = 19531M bytes = 19G bytes,
19531M / 9.6 hr = 2034M / h = 578K bytes / s if the request is uniformly distributed, the need 5M (640K bytes) Bandwidth (5Mb = 640KB attention to the case, b is the bit, B is the byte, the 8-fold difference ), but all requests can not be evenly distributed, when a peak bandwidth of 5M sure enough, X2 is twice the bandwidth of 10M. 10M of bandwidth to meet the basic requirements.
These are the assumptions 20k bytes per page, basically does not contain pictures, if the picture contains even greater, 10M bandwidth can not meet the requirements. Your own calculation right.
(Applause.)

 

Appendix: Basic Concepts Performance Test
-------------------------------------------- ------------------------------------------- 
basic concepts: 
throughput (throughput ): according to conventional understanding network throughput in unit time represents the amount of data of the card and which comprises an amount of data that is sent to the card of the present machine also includes an amount of data received by the NIC native. A 100Mb (bit) duplex card, the maximum transmission data rate is 12.5M bytes / s, the maximum speed is 12.5M received data bytes / s, can  simultaneously send and receive  data. 
Number of concurrent users: simultaneously user operation is performed (number of threads). 
Response time: the response is received to the time it takes emitted from the request.

QPS - Queries Per Second the number of queries processed per second (if it is a database, the equivalent of reading)
TPS - Transactions Per Second Number of transactions processed per second (if a database is equivalent to write, modify)
IOPS, per second the disk I / O operation times

for example, a database test, and separate the two measured QPS TPS.
QPS (read) is always higher than the value of TPS (write, change), and there magnification relationship, because:
1, the database may have cached query.
2, the mechanical hard disk read or SSD drive is faster than writing. 
-------------------------------------------------- ------------------------------------- 
the JMeter test parameters Description: 

the Label: the name of each test unit . 

#Samples: represents a test unit issued a total number of requests. 

Average: Average response time - the default is the average response time of a single Request, the Controller Transaction when used, may be displayed in units of Transaction Average response time. ,unimportant. 

Median: median, i.e. 50% of the user response time, if the response time of the ascending sort order, then the 50% response time of requests within this range. important. 

90% Line: 90% of the user response time, if the response time of the ascending sort order, then the response time of 90% of the requests within this range. important. 

Min: minimum response time is not important. 

Max: maximum response time, the odds of just a thousandth or even a million, is not important. 

Error%: bad requests according to the number of test 

Throughput: Throughput - the default number of completed requests per second (Request per Second) represents a case where, when the Transaction Controller, may also represent a similar Transaction per LoadRunner second number 

KB / Sec: (just received) per the amount of data received at the server, corresponding to the LoadRunner Throughput / Sec 
--------------------- -------------------------------------------------- ---------------- 
LoadRunner test parameters:  

response time:  take the value of 90%, if the response time of the ascending sort order, then the response time of 90% of the requests in this range within. important. 

Hits per second  : hits per Second, the number of requests per second submitted to the server. 

The TPS:  the Transaction per Second, the number of transactions per second, a transaction is a client sends a request to the server and the server responding process 

Throughput (throughput):  Loadrunner Throughput record is returned by the server receives the number of all bytes and, regardless of the number of bytes sent to the local. 

Throughput / Sec:  per second throughput. 

BS architecture for general analysis of response time, click-through rate, throughput, TPS (transactions per second). 
CS architecture for general analysis TPS (transactions per second) 
 

 

Guess you like

Origin www.cnblogs.com/accumulating/p/11440739.html