linux测试命令ab

ab命令

ab----apache bench是apache下的一个工具,主要用于对web站点做压力测试,它可以测试安装Web服务器每秒种处理的HTTP请求

常见参数说明

参数说明
-n请求次数
-c每次的并发
-p发送POST请求时需要上传的文件,此外还必须设置-T参数
-TContent-Type请求头信息例如–application/x-www-form-urlencoded
-C添加cookid
-e输出结果信息到CSV格式的文件中

具体可查看

man  ab

结果说明

Server Software:        TornadoServer/5.0.2                          #软件
Server Hostname:        xxx.xxx.xx.xxx                               #IP地址
Server Port:            12345                                        #端口     

Document Path:          /parser                                      #路径
Document Length:        3190 bytes                                   # 页面的字节

Concurrency Level:      5                                            #当前并发
Time taken for tests:   3.158 seconds                                #测试耗时
Complete requests:      100                                          #总的请求次数
Failed requests:        0                                            #失败请求
Write errors:           0                                            #error信息
Total transferred:      333700 bytes                                 # 总共传输的数据量
Total POSTed:           36200                                        
HTML transferred:       319000 bytes                                 
Requests per second:    31.66 [#/sec] (mean)                         #每秒处理的请求数,等于100/3.158
Time per request:       157.911 [ms] (mean)                          #完成一个请求的平均时间,并发数量不止一个
Time per request:       31.582 [ms] (mean, across all concurrent requests)   #服务器平均处理时间,31.582*5=157.911
Transfer rate:          103.18 [Kbytes/sec] received                 #网络传输速度
                        11.19 kb/s sent
                        114.38 kb/s total

# 对  Time per request:       157.911的分析
Connection Times (ms)
              min  mean[+/-sd] median   max
Connect:        8    9   0.9      9      11
Processing:    44  146  22.8    146     260
Waiting:       44  145  22.7    145     260
Total:         52  155  22.8    154     268

#网络请求的分布情况
Percentage of the requests served within a certain time (ms)
  50%    154
  66%    161
  75%    165
  80%    168
  90%    174
  95%    178
  98%    238
  99%    268
 100%    268 (longest request)

参考文献:
1、https://blog.csdn.net/feiwutudou/article/details/80334099
2、https://blog.csdn.net/qq_27517377/article/details/78794409

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值