Number of concurrent connections SBC (Simultaneous Browser Connections)
The number of concurrent connections means that the client initiates a request to the server and establishes a TCP connection. The total number of TCP connections to the server per second is the number of concurrent connections.
Number of requests QPS (Query Per Second)/RPS (Request Per Second)
There are two abbreviations for the number of requests, which can be called QPS or RPS. The unit is how many requests per second. Query=query, also equivalent to request. The number of requests refers to the fact that the client sends GET/POST/HEAD packets to the http service after the connection is established, and there are two situations after the server returns the request result:
The http data packet header contains the word Close, which closes this TCP connection;
The header of the http data packet contains the word KeepAlive, the connection is not closed this time, and the request can continue to be sent to the http service through the connection, which is used to reduce the number of concurrent TCP connections.
How to measure server performance?
Usually, what we test is QPS, which is the number of requests per second. However, in order to measure the overall performance of the server, it is best to test the number of concurrent connections and the number of requests together during the test.
Test principle
To test the number of concurrent connections, each concurrent 1 request is used, and multiple concurrent connections are performed;
The number of test requests is multi-concurrent, and each concurrent multiple requests are used. The total number of requests will be equal to the number of concurrent requests and the number of single concurrent requests. It should be noted that the results obtained by different concurrent and single concurrent requests will be different, so the best It is good to test multiple times and take the average.
What is the point of distinguishing the number of requests?
You open the Chrome browser, press F12, switch to the Network tab, open any web page, press F5 to refresh, and you will see a bunch of requests. Here is the number of concurrent connections to a single site generated by different browsers collected by a big cow:
Browser HTTP 1.1 HTTP 1.0
IE 6,7 2 4
IE 8 6 6
Firefox 2 2 8
Firefox 3 6 6
Safari 3, 4 4 4
Chrome 1,2 6?
Chrome 3 4 4
Opera 9.63, 10.00alpha 4 4
Take Chrome as an example, assuming that the server is set to Close (non-persistent connection), after the browser opens the webpage, it first opens 4 concurrent loads of data, closes 4 connections after these requests are completed, and then opens 4 concurrent connections to load data. In other words, it is not that 100 requests for this web page will generate 100 concurrency, but 4 concurrent connections in parallel. Assuming that the server is set to keepalive (persistent connection), after the browser opens the webpage, it first opens 4 concurrently loaded data, and does not close the connection after these requests are completed, but continues to send requests, saving the time to reopen the connection. [The red mark in front is the difference between keepalive persistent connection and close non-persistent connection. Except for Squid (which uses a special method to achieve persistent connection in http 1.0), persistent connection is only valid in http 1.1 protocol! 】
How many people can the host be online?
I believe you already know the answer here. There is no solution to this question. Depending on the content size of the webpage, the number of requests for a single webpage, and the configuration of the server, the floating value of this data is very large, so it cannot be measured. Therefore, it is a cheating host company to promise how many users are online!
concurrent users
There are two common misconceptions about the number of concurrent users. A wrong view is to understand the number of concurrent users as the number of all users using the system, because these users may use the system at the same time; another view that is closer to the correct view is to understand the number of online users as the number of concurrent users. In fact, online users may not necessarily be concurrent with other users. For example, users who are browsing the web have no impact on the server. However, the number of online users is one of the main bases for counting the number of concurrent users.
Concurrency is mainly for the server. The key to whether it is concurrency is to see whether user operations have an impact on the server. Therefore, the correct understanding of the number of concurrent users is: the number of online users who interact with the server at the same time. The biggest feature of these users is that they interact with the server, which can be either one-way data transmission or two-way data transmission.
There is currently no accurate formula for counting the number of concurrent users, because different systems have different concurrency characteristics. For example, the empirical formula for counting the number of concurrent users in the OA system is: use the number of system users (5%~20%). For this formula, there is no need to stick to the calculation results, because in order to ensure the expansion space of the system, the number of concurrent users during the test should be slightly larger, unless it is to test the maximum number of concurrent users that the system can carry. For example: If the expected number of users of an OA system is 1000, as long as the test shows that the system can support 200 concurrent users.