ab(ApacheBench)is Apache http performance test tools.
Case: Send 10 concurrency requests to open index page at same time and run 100 times.
Input the below command at CMD shell: ab -n 10 -c 10 http://10.136.4.22/
The result will be show as below:
C:/Program Files/Apache Software Foundation/Apache2.2/bin>ab -n 100 -c 10 http://10.136.4.22/
This is ApacheBench, Version 2.0.40-dev <$Revision: 1.146 $> apache-2.0
Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
Copyright 2006 The Apache Software Foundation, http://www.apache.org/
Benchmarking 10.136.4.22 (be patient).....done
Server Software:
Server Hostname: 10.136.4.22
Server Port : 80
Document Path: /
Document Length: 1614 bytes
Concurrency Level: 10
Time taken for tests: 210.46875 seconds
Complete requests: 100
Failed requests: 8
(Connect: 8, Length: 0, Exceptions: 0)
Write errors: 0
Total transferred: 165500 bytes
HTML transferred: 161400 bytes
Requests per second: 0.48 [#/sec] (mean)
Time per request: 21004.688 [ms] (mean)
Time per request: 2100.469 [ms] (mean, across all concurrent requests)
Transfer rate: 0.77 [Kbytes/sec] received
Connection Times (ms)
min mean[+/-sd] median max
Connect: 0 419 1273.0 0 8937
Processing: 31 18870 26075.4 3016 66078
Waiting: 31 8580 17128.0 3015 63093
Total: 31 19290 26039.3 3031 66093
Percentage of the requests served within a certain time (ms)
50% 3031
66% 6015
75% 54000
80% 54015
90% 65968
95% 65984
98% 66000
99% 66093
100% 66093 (longest request)
Conclusion:
From the result, you can find: It cost 210.46875 seconds to run 100 times 10 concurrency request.
The server can process 048 requests per second.