Created
January 24, 2014 02:14
-
-
Save JingwenTian/8590918 to your computer and use it in GitHub Desktop.
使用ab对nginx进行压力测试
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#ubuntu安装ab | |
#apt-get install apache2-utils | |
#测试之前需要准备一个简单的html、一个php、一个图片文件。 | |
#分别对他们进行测试。 | |
##################################################################################### | |
#ab.html | |
root@jing:~#ab -kc 1000 -n 1000 http://192.241.233.63/example/ab/ab.html | |
This is ApacheBench, Version 2.3 <$Revision: 655654 $> | |
Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/ | |
Licensed to The Apache Software Foundation, http://www.apache.org/ | |
Benchmarking 192.241.233.63 (be patient) | |
Completed 100 requests | |
Completed 200 requests | |
Completed 300 requests | |
Completed 400 requests | |
Completed 500 requests | |
Completed 600 requests | |
Completed 700 requests | |
Completed 800 requests | |
Completed 900 requests | |
Completed 1000 requests | |
Finished 1000 requests | |
Server Software: nginx | |
Server Hostname: 192.241.233.63 | |
Server Port: 80 | |
Document Path: /example/ab/ab.html | |
Document Length: 69 bytes | |
Concurrency Level: 1000 | |
Time taken for tests: 0.165 seconds | |
Complete requests: 1000 | |
Failed requests: 0 | |
Write errors: 0 | |
Keep-Alive requests: 1000 | |
Total transferred: 277000 bytes | |
HTML transferred: 69000 bytes | |
Requests per second: 6065.46 [#/sec] (mean) | |
Time per request: 164.868 [ms] (mean) | |
Time per request: 0.165 [ms] (mean, across all concurrent requests) | |
Transfer rate: 1640.75 [Kbytes/sec] received | |
Connection Times (ms) | |
min mean[+/-sd] median max | |
Connect: 45 56 5.2 57 64 | |
Processing: 31 41 7.1 39 58 | |
Waiting: 29 41 7.1 39 58 | |
Total: 89 97 4.7 97 107 | |
Percentage of the requests served within a certain time (ms) | |
50% 97 | |
66% 99 | |
75% 101 | |
80% 102 | |
90% 103 | |
95% 104 | |
98% 106 | |
99% 106 | |
100% 107 (longest request) | |
##################################################################################### | |
#ab.php | |
root@jing:~# ab -kc 1000 -n 1000 http://192.241.233.63/example/ab/ab.php | |
This is ApacheBench, Version 2.3 <$Revision: 655654 $> | |
Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/ | |
Licensed to The Apache Software Foundation, http://www.apache.org/ | |
Benchmarking 192.241.233.63 (be patient) | |
Completed 100 requests | |
Completed 200 requests | |
Completed 300 requests | |
Completed 400 requests | |
Completed 500 requests | |
Completed 600 requests | |
Completed 700 requests | |
Completed 800 requests | |
Completed 900 requests | |
Completed 1000 requests | |
Finished 1000 requests | |
Server Software: nginx | |
Server Hostname: 192.241.233.63 | |
Server Port: 80 | |
Document Path: /example/ab/ab.php | |
Document Length: 166 bytes | |
Concurrency Level: 1000 | |
Time taken for tests: 0.238 seconds | |
Complete requests: 1000 | |
Failed requests: 150 | |
(Connect: 0, Receive: 0, Length: 150, Exceptions: 0) | |
Write errors: 0 | |
Non-2xx responses: 850 | |
Keep-Alive requests: 850 | |
Total transferred: 295000 bytes | |
HTML transferred: 142900 bytes | |
Requests per second: 4194.05 [#/sec] (mean) | |
Time per request: 238.433 [ms] (mean) | |
Time per request: 0.238 [ms] (mean, across all concurrent requests) | |
Transfer rate: 1208.25 [Kbytes/sec] received | |
Connection Times (ms) | |
min mean[+/-sd] median max | |
Connect: 44 65 12.1 64 86 | |
Processing: 24 56 31.4 47 146 | |
Waiting: 23 56 31.4 47 146 | |
Total: 100 121 35.9 108 227 | |
Percentage of the requests served within a certain time (ms) | |
50% 108 | |
66% 112 | |
75% 115 | |
80% 116 | |
90% 204 | |
95% 216 | |
98% 223 | |
99% 225 | |
100% 227 (longest request) | |
##################################################################################### | |
#ab.png | |
root@jing:~# ab -kc 1000 -n 1000 http://192.241.233.63/example/ab/ab.png | |
This is ApacheBench, Version 2.3 <$Revision: 655654 $> | |
Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/ | |
Licensed to The Apache Software Foundation, http://www.apache.org/ | |
Benchmarking 192.241.233.63 (be patient) | |
Completed 100 requests | |
Completed 200 requests | |
Completed 300 requests | |
Completed 400 requests | |
Completed 500 requests | |
Completed 600 requests | |
Completed 700 requests | |
Completed 800 requests | |
Completed 900 requests | |
Completed 1000 requests | |
Finished 1000 requests | |
Server Software: nginx | |
Server Hostname: 192.241.233.63 | |
Server Port: 80 | |
Document Path: /example/ab/ab.png | |
Document Length: 44719 bytes | |
Concurrency Level: 1000 | |
Time taken for tests: 0.188 seconds | |
Complete requests: 1000 | |
Failed requests: 0 | |
Write errors: 0 | |
Keep-Alive requests: 1000 | |
Total transferred: 45002000 bytes | |
HTML transferred: 44719000 bytes | |
Requests per second: 5314.80 [#/sec] (mean) | |
Time per request: 188.154 [ms] (mean) | |
Time per request: 0.188 [ms] (mean, across all concurrent requests) | |
Transfer rate: 233570.72 [Kbytes/sec] received | |
Connection Times (ms) | |
min mean[+/-sd] median max | |
Connect: 31 48 8.8 48 63 | |
Processing: 32 53 20.2 44 97 | |
Waiting: 25 51 22.0 44 97 | |
Total: 85 101 12.2 97 128 | |
Percentage of the requests served within a certain time (ms) | |
50% 97 | |
66% 103 | |
75% 111 | |
80% 114 | |
90% 121 | |
95% 125 | |
98% 127 | |
99% 127 | |
100% 128 (longest request) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment