Apache ab 的安装使用

1.下载地址 https://www.apachehaus.com/cgi-bin/download.plx

2.解压配置端口 和 安装路径

配置文件 httpd.conf

Listen 80 换成 一个不常用的端口号 如: Listen 13352

Define SRVROOT 路径改为解压路径 如:"C:\Users\admin\Downloads\Apache24"

3.httpd -k install  添加apache服务

输入 http://localhost:13352/  有页面则成功

4.启动服务,开始测试

进入ab.exe 所在目录

ab -n 100 -c 10 http://www.baidu.com/index

其中,-n 表示请求数,-c 表示并发数,index 不可以缺少,否则会报url错误

5.测试结果分析

Server Software:        Apache
Server Hostname:        www.baidu.com
Server Port:            80


Document Path:          http://www.baidu.com/index
Document Length:        222 bytes #请求文档大小


Concurrency Level:      10 #并发数
Time taken for tests:   0.531 seconds #全部请求完成耗时
Complete requests:      100  #全部请求数
Failed requests:        0   #失败请求数
Non-2xx responses:      100
Total transferred:      50200 bytes  #总传输大小
HTML transferred:       22200 bytes  #总传输html内容量
Requests per second:    188.15 [#/sec] (mean) #每秒请求数 mean 表示这个数据是一个平均值
Time per request:       53.149 [ms] (mean)  #每次并发请求时间
Time per request:       5.315 [ms] (mean, across all concurrent requests) #每个请求实际运行平均时间
Transfer rate:          92.24 [Kbytes/sec] received # 传输速率 平均每秒网络上的流量


Connection Times (ms)
              min  mean[+/-sd] median   max
Connect:        2    5   2.9      4      15
Processing:    11   45  12.9     44      82
Waiting:        6   28  16.0     26      82
Total:         20   50  12.7     49      90


Percentage of the requests served within a certain time (ms)
  50%     49                   # 50%的请求在49 ms内
  66%     52                   # 66%的请求在52 ms内
  75%     53
  80%     59
  90%     71
  95%     78
  98%     85
  99%     90
 100%     90 (longest request)    




参考链接:

https://www.cnblogs.com/jave1ove/p/5486427.html

http://blog.csdn.net/ahaaaaa/article/details/51514175

http://blog.csdn.net/blind_code/article/details/24005231

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

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值