标签:
终端输入
ab -n 100 -c 100 测试目标url
AB指令介绍
-n requests 全部请求数 -c concurrency 并发数 -t timelimit 最传等待回应时间 -p postfile POST数据文件 -T content-type POST Content-type -v verbosity How much troubleshooting info to print -w Print out results in HTML tables -i Use HEAD instead of GET -x attributes String to insert as table attributes -y attributes String to insert as tr attributes -z attributes String to insert as td or th attributes -C attribute 加入cookie, eg. ‘Apache=1234. (repeatable) -H attribute 加入http头, eg. ‘Accept-Encoding: gzip‘ Inserted after all normal header lines. (repeatable) -A attribute http验证,分隔传递用户名及密码 -P attribute Add Basic Proxy Authentication, the attributes are a colon separated username and password.
返回测试内容介绍
100用户 100请求 Server Software: nginx Server Hostname: pay-stress.com Server Port: 80 Document Path: /api/TestYeepay/debitPayRequest?access_token=vacir7FYdZwfaiP61p6XxpoenIiSutqN71bfghGF Document Length: 102 bytes //页面大小 Concurrency Level: 100 //并发数 Time taken for tests: 1.546 seconds //测试花费时间 Complete requests: 100 完全请求 Failed requests: 12 失败请求 (Connect: 0, Receive: 0, Length: 12, Exceptions: 0) Write errors: 0 Total transferred: 26348 bytes //总传输字节 HTML transferred: 10289 bytes //去除header的字节 Requests per second: 64.68 [#/sec] (mean) //每秒处理的请求数,服务器的吞吐量,等于:Complete requests / Time taken for tests Time per request: 1546.164 [ms] (mean) //服务器平均处理时间 Time per request: 15.462 [ms] (mean, across all concurrent requests) //平均数,用户平均请求等待时间(第一个Time per request时间约等于第二个Time per request时间乘以并发请求数。) Transfer rate: 16.64 [Kbytes/sec] received //平均传输速率(每秒收到的速率)。可以很好的说明服务器在处理能力达到限制时,其出口带宽的需求量。 Connection Times (ms) //压力测试时的连接处理时间。 min mean[+/-sd] median max Connect: 43 58 9.7 57 74 Processing: 164 1165 131.7 1190 1307 Waiting: 151 1164 132.6 1189 1307 Total: 207 1223 133.0 1263 1351 Percentage of the requests served within a certain time (ms) 50% 1263 66% 1278 75% 1314 80% 1315 90% 1337 95% 1343 98% 1348 99% 1351 100% 1351 (longest request) //50%的用户响应时间小于1263毫秒,66% 的用户响应时间小于1278毫秒,最大的响应时间小于1351 毫秒。
标签:
原文地址:http://my.oschina.net/xinson/blog/514119