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

你可能感兴趣的:(apache,apacheAb,操作系统)