window安装ab压力测试

ab是Apache HTTP server benchmarking tool的缩写,可以用以测试HTTP请求的服务器性能,也是业界比较流行和简单易用的一种压力测试工具包

## 下载

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


## 解压

将解压的bin目录用命令行打开



## 测试
```
ab -n 100 -c 10 http://test_url
# -n 表示请求数,-c 表示并发数. -t 表示多少s内并发和请求

```

文档在此:http://httpd.apache.org/docs/2.0/programs/ab.html

## 结果

```

C:\Users\Administrator\Downloads\httpd-2.4.33-o102o-x64-vc14-r2\Apache24\bin>ab -n 1000 -c 1000  http://192.168.37.162:8999/longfor/tableauServlet
This is ApacheBench, Version 2.3 <$Revision: 1826891 $>
Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
Licensed to The Apache Software Foundation, http://www.apache.org/


Benchmarking 192.168.37.162 (be patient)
Completed 100 requests
Completed 200 requests
Completed 300 requests
Completed 400 requests
Completed 500 requests
Completed 600 requests
Completed 700 requests
Completed 800 requests
Completed 900 requests
Completed 1000 requests
Finished 1000 requests




Server Software:
Server Hostname:        192.168.37.162
Server Port:            8999


#请求url
Document Path:          /longfor/tableauServlet
#页面数据/返回的数据量
Document Length:        63 bytes


#并发数
Concurrency Level:      1000
#共使用了多少时间 
Time taken for tests:   13.182 seconds
#完成请求数
Complete requests:      1000
#失败请求
Failed requests:        0
 
#总共传输字节数,包含http的头信息等
Total transferred:      287000 bytes
#html字节数,实际的页面传递字节数
HTML transferred:       63000 bytes
#每秒多少请求,这个是非常重要的参数数值,服务器的吞吐量
Requests per second:    75.86 [#/sec] (mean)
#用户平均请求等待时间
Time per request:       13181.754 [ms] (mean)
##服务器平均处理时间,也就是服务器吞吐量的倒数
Time per request:       13.182 [ms] (mean, across all concurrent requests)
#每秒获取的数据长度
Transfer rate:          21.26 [Kbytes/sec] received








##连接的最小时间,平均值,中值,最大值
Connection Times (ms)
              min  mean[+/-sd] median   max
Connect:        4   13 117.5      6    3005
##处理时间66
Processing:    84 7105 4444.4   7583   13086
##等待时间
Waiting:       22 7049 4464.0   7532   13059
##合计时间
Total:         91 7118 4442.9   7589   13092


Percentage of the requests served within a certain time (ms)
  50%   7589
  ## 50%的请求在7589ms内返回 
  66%   9792
  ## 66%的请求在9792ms内返回 
  75%  11526
  80%  11832
  90%  12460
  95%  12778
  98%  12962
  99%  13024
 100%  13092 (longest request)

```

修改解压根目录下的conf/httpd.conf文件的端口配置,默认是80端口,应该是被占用了

猜你喜欢

转载自blog.csdn.net/tengxing007/article/details/80919798