The previous article has said, recently received the task of optimizing interface and SQL, contacted the druid, monitoring the SQL, and now start the interface of the stress test, here using Apache's own performance test tool--ab (not Anglababy OH)
First look at AB. Apache's AB command simulates multithreaded concurrent requests, tests server load pressures, and also tests Nginx, Lighthttp, IIS, and other Web servers.
The AB command is so low on the computer that it does not take up a lot of CPU, it does not consume too much memory, but it can cause a huge load on the target server, so it is a necessary medicine for some DDoS attacks, for all ages. Use your own discretion as well. Otherwise, at one time too much load, resulting in the target server directly due to memory consumption of the crash, but have to hard restart, the gains.
In the case of insufficient bandwidth, it is best to test the machine, the proposed use of another intranet or multiple servers through the intranet to test, so that the data, the accuracy will be much higher. Remote Web server stress testing, often ineffective (because network latency is too large or insufficient bandwidth).
(The above explanation comes from the network ...)
============================= Split Line =============================
Now let's start with AB.
1. First you have to have Apache installed.
2. Open the Doc window, enter into the directory where Ab.exe (Apache bin folder) input AB, open AB program.
The use of 3.ab is: ab-n 30000-c 1000 http://localhost:8080/honghclient/sysmessage/getmyunread?info={"AccountId": " 9000000001001003031 "," ToType ":" 1 "}
In this example, the parameter meaning is as follows:
-N: Total number of request executions, default is 1 ;
-C: Concurrent number, default is 1;
-T: Total time of the test, in seconds, by default 50000s
Data files when-p:post
-W: Output results in HTML table format
4. Then wait for the test results (the following single example)
Document Path:/honghclient/sysmessage/getmyunread?info={accountid:9000000001001003031,totype:1}
Document length:1045 bytes The body length of HTTP response data
Concurrency level:1000
Time taken for tests:258.412 seconds all of the Times that these requests were processed to complete
Number of Complete requests:30000 completion requests
Failed requests:1 number of failed requests
(Connect:1, receive:0, length:0, exceptions:0)
Non-2xx responses:30000
Total transferred:37770000 Bytes Net transfer volume
HTML transferred:31350000 bytes HTML content transfer Volume
Requestsper second:116.09 [#/sec] (mean) throughput-number of requests per second
Time perrequest:8613.745 [MS] (mean) server receives request, Response page takes
Time perrequest:8.614 [MS] (mean, acrossall concurrent requests) Average cost per request
######################### #添加索引 (Accoundid of Bas_message_readlog)
Requestsper second:249.04 [#/sec] (mean)
Time perrequest:4015.406 [MS] (mean)
Time perrequest:4.015 [MS] (mean, acrossall concurrent requests)
######################### #添加索引 (MessageID of Bas_message_readlog)
Requestsper second:263.79 [#/sec] (mean)
Time perrequest:3790.832 [MS] (mean)
Time perrequest:3.791 [MS] (mean, acrossall concurrent requests)
Transfer rate:142.74 [Kbytes/sec] received the average traffic on the network per second to help eliminate the problem of excessive network traffic leading to longer response times
Connection Times (MS)
Min MEAN[+/-SD] Median max
Decomposition of time consumed on the network:
Connect:0 4 43.6 0 699
processing:94 8534 25612.8 3456 154885
waiting:22 6607 23785.7 2376 154873
total:94 8538 25613.0 3459 15488
The response of all requests in the entire scenario. Each request has a response time in the scene
50% of the user response time is less than 3459 milliseconds
80 user response time is less than 3883 milliseconds
Maximum response time is less than 154885 milliseconds
Percentage of the requests served within Acertain time (MS)
50% 3459
66% 3694
75% 3794
80% 3883
90% 4839
95% 10084
98% 145947
99% 146148 100% 154885 (longest request)