I. Several Basic concepts to be mastered in stress testing
1: requests per second)
The quantitative description of the server's concurrent processing capability. The unit is reqs/S. It refers to the number of requests processed per unit time under a number of concurrent users. The maximum number of requests that can be processed per unit time under a number of concurrent users is called the maximum throughput.
Remember: The throughput is based on the number of concurrent users. This statement represents two meanings: 1. throughput is related to the number of concurrent users; 2. throughput is generally different for different concurrent users.
Calculation formula: Total number of requests/time taken to process the number of completed requests, that is
Request per second = complete requests/time taken for tests
2: Number of concurrent connections)
The number of concurrent connections refers to the number of requests received by the server at a certain time point. Simply put, it is a session.
3: Number of concurrent users (the number of concurrent users, concurrency level)
Note the difference between this concept and the number of concurrent connections. A user may have multiple sessions, that is, the number of connections. In HTTP/1.1, IE7 supports two concurrent connections, IE8 supports six concurrent connections, and firefox3 supports four concurrent connections. Therefore, the number of concurrent users must be divided by this base.
4: average user request wait time (time per request)
Calculation formula: time spent on processing all requests/(total number of requests/number of concurrent users), that is
Time per request = time taken for tests/(complete requests/concurrency level)
5: Average Server Request wait time (time per request: Wait SS all concurrent requests)
Calculation formula: the time/total number of requests processed
Time taken for/testscomplete requests
We can see that it is the reciprocal of the throughput.
At the same time, it also = average user request wait time/number of concurrent users, that is
Time per request/concurrency level
II. Specific Practices
1: select a stress testing tool
Heavyweight tools include Visual Studio Tools and loader runner (LR). Lightweight tools include apachetings in the Apache project, or AB for short. You can download AB .zip here.
2: simple use of AB and parameter Introduction
The above test is based on one of my Asp.net pages. Stress testing must be performed all the time. If you do not know how many concurrent users your application can host, it is basically a time bomb.
NOTE: For the problem with parameters and data, refer to: http://stackoverflow.com/questions/4885857/how-to-send-more-than-one-query-string-in-apache-bench