参考: https://blog.csdn.net/helencoder/article/details/52457078
ab常用参数的介绍:
-n :总共的请求执行数,缺省是1;
-c: 并发数,缺省是1;
-t:测试所进行的总时间,秒为单位,缺省50000s
-p:POST时的数据文件
-w: 以HTML表的格式输出结果
ab -g a.csv -n 1000 -c 10 -p data https://10.9.147.38:443/risk 1>file
ab -g a.csv -n 1000 -c 10 -p data -w https://10.9.147.38:443/risk 1>file.html
两个结果有点儿差异,如下: 这样看还是用非html的好一点儿,自己的ab是 Version 2.3
file中
Document Length: 63 bytes Concurrency Level: 10 Time taken for tests: 1.304 seconds Complete requests: 1000 Failed requests: 0 Write errors: 0 Total transferred: 379000 bytes Total body sent: 1203000 HTML transferred: 63000 bytes Requests per second: 766.75 [#/sec] (mean) Time per request: 13.042 [ms] (mean) Time per request: 1.304 [ms] (mean, across all concurrent requests) Transfer rate: 283.79 [Kbytes/sec] received 900.78 kb/s sent 1184.56 kb/s total Connection Times (ms) min mean[+/-sd] median max Connect: 5 7 1.2 7 12 Processing: 2 6 3.4 5 41 Waiting: 2 5 3.3 5 41 Total: 7 13 3.4 13 48 Percentage of the requests served within a certain time (ms) 50% 13 66% 13 75% 14 80% 14 90% 15 95% 16 98% 17 99% 36 100% 48 (longest request)
file.html中
This is ApacheBench, Version 2.3 <$Revision: 1430300 $> Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/ Licensed to The Apache Software Foundation, http://www.apache.org/ Server Software: nginx Server Hostname: 10.9.147.38 Server Port: 443 Document Path: /api/v4/ip/reputation_risk Document Length: 63 bytes Concurrency Level: 10 Time taken for tests: 1.285 seconds Complete requests: 1000 Failed requests: 0 Total transferred: 379000 bytes Total body sent: 1203000 HTML transferred: 63000 bytes Requests per second: 778.08 Transfer rate: 294890.69 kb/s received 936025.06 kb/s sent 1230915.75 kb/s total Connnection Times (ms) min avg max Connect: 5 7 13 Processing: 3 5 7 Total: 8 12 20
没有评论:
发表评论