ab访问测压工具

测压工具的名称:httpd-tools

这工具是测试网站的并发访问量使用的工具,apache-httpd 会自带,nginx等其他web,需要下载。

使用方法:ab

常用参数为-n、-c

参数解析
-n要执行的请求数
-cconcurrency 一次发出的多个请求的数量
-ttimelimit 秒到最大值。花在基准测试上这意味着 -n 50000
-stimeout 秒到最大值。等待每个响应默认为 30 秒
-bwindowsize TCP 发送/接收缓冲区的大小,以字节为单位
-Baddress 进行传出连接时绑定的地址
-postfile 包含要 POST 的数据的文件。还记得设置 -T
-uputfile 包含要 PUT 的数据的文件。还记得设置 -T
-Tcontent-type 用于 POST/PUT 数据的内容类型标头,例如。'应用程序/xwww-form-urlencoded’默认为“文本/纯文本”
-vverbosity 要打印多少故障排除信息
-w在 HTML 表格中打印结果
-i使用 HEAD 而不是 GET
-x属性 要作为表属性插入的字符串
-y属性字符串作为 tr 属性插入
-z属性字符串作为 td 或 th 属性插入
-C属性 添加 cookie,例如。 ‘阿帕奇= 1234’。 (可重复)
-H属性添加任意标题行,例如。 '接受编码:gzip’在所有正常标题行之后插入。 (可重复)
-A属性 添加 Basic WWW Authentication,属性是冒号分隔的用户名和密码。
-P属性 添加Basic Proxy Authentication,属性是冒号分隔的用户名和密码。
-Xproxy:port 代理服务器和使用的端口号
-V打印版本号并退出
-k使用 HTTP KeepAlive 功能
-d不显示百分位数服务表
-S不显示置信度估计值和警告。
-q执行超过 150 个请求时不显示进度
-gfilename 将收集到的数据输出到 gnuplot 格式文件。
-efilename 输出带有百分比的 CSV 文件
-r不要在套接字接收错误时退出
-h显示使用信息(此消息)
-Zciphersuite 指定 SSL/TLS 密码套件(参见 openssl 密码)
-fprotocol 指定 SSL/TLS 协议
[root@localhost ~]# ab -n 1000 -c 5 http://www.1.html.com/
This is ApacheBench, Version 2.3 <$Revision: 1430300 $>
Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
Licensed to The Apache Software Foundation, http://www.apache.org/

Benchmarking www.1.html.com (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:        nginx/1.20.1     ##探测的版本号
Server Hostname:        www.1.html.com	##主机名字
Server Port:            80				##端口

Document Path:          /			##探测位置
Document Length:        52 bytes	##多少字节

Concurrency Level:      5			##探测次数
Time taken for tests:   0.188 seconds	##测试时间
Complete requests:      1000			##测试次数
Failed requests:        0				##失败次数
Write errors:           0				##
Total transferred:      283000 bytes	##传输字节
HTML transferred:       52000 bytes		##包字节
Requests per second:    5330.95 [#/sec] (mean)
Time per request:       0.938 [ms] (mean)  	
Time per request:       0.188 [ms] (mean, across all concurrent requests)
Transfer rate:          1473.30 [Kbytes/sec] received

Connection Times (ms)
              min  mean[+/-sd] median   max
Connect:        0    0   0.3      0       3
Processing:     0    1   0.4      0       5
Waiting:        0    0   0.4      0       5
Total:          0    1   0.6      1       6
ERROR: The median and mean for the processing time are more than twice the standard
       deviation apart. These results are NOT reliable.

Percentage of the requests served within a certain time (ms)
  50%      1
  66%      1
  75%      1
  80%      1
  90%      1
  95%      2
  98%      3
  99%      4
 100%      6 (longest request)

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

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值