ab -n100 -c10 http://www.163.com
其中-n 100表示总共发起100个连接请求,而-c 10表示同时维持10个并发
ab -t 60 -c 100 http://192.168.0.10/
在60秒内发请求,一次100个请求。
ab:错误的数量的参数
用法:ab[选项][http://]主机名:端口/路径
选项有:
- n请求执行的请求数
- c并发数量的多个请求
马克斯- t时限秒。等待响应
p postfile文件包含的数据发布
对发布- t - type - type头
- v冗长多少故障排除信息打印
在HTML表- w打印出结果
我用头代替
- x属性字符串插入如表属性
- y属性字符串插入作为tr属性
- z属性字符串插入td或属性
- c属性添加饼干,如。Apache = 1234。(重复)
- h属性添加任意标题行,如:“接受编码:gzip”
毕竟正常插入标题行。(重复)
——属性添加基本WWW认证,属性
是冒号分隔的用户名和密码。
p属性添加基本的代理身份验证,属性
是冒号分隔的用户名和密码。
- x代理:港口Proxyserver和端口号
- v打印版本号并退出
- k使用HTTP KeepAlive特性
d不显示百分比表。
- s不展示自信估计和警告。
- g文件名gnuplot格式文件收集的数据输出。
- e文件名与百分比输出CSV文件
- h显示使用信息(这个消息)
Server Software: Microsoft-IIS/7.5 服务器软件
Server Hostname: www.1111.cn 服务器主机名
Server Port: 80 服务器端口
Document Path: / 文件路径
Document Length: 353763 bytes 文件长度
Concurrency Level: 200 并发级别
Time taken for tests: 62.912599 seconds 时间测试
Complete requests: 1000 完成请求
Failed requests: 0 请求失败
Write errors: 0 写错误
Total transferred: 354165000 bytes 总传输
HTML transferred: 353763000 bytes HTML转移
Requests per second: 15.90 [#/sec] (mean) 每秒请求 (每秒处理15.9的请求)
Time per request: 12582.520 [ms] (mean) 用户平均请求等待的时间
Time per request: 62.913 [ms] (mean, across all concurrent requests) 每个请求的消耗时间 毫秒
Transfer rate: 5497.53 [Kbytes/sec] received 传输速率
Connection Times (ms) 连接次数
min mean[+/-sd] median max
Connect: 16 58 233.7 26 3047 连接
Processing: 790 11694 4009.8 9704 20520 处理
Waiting: 162 1262 1285.2 730 5555 等待
Total: 866 11753 4010.7 9772 20556 总
Percentage of the requests served within a certain time (ms) 在一定比例的请求服务时间
50% 9772
66% 14173
75% 14675
80% 15176
90% 18101
95% 18875
98% 19481
99% 19864
100% 20556 (longest request) 最长的请求