centos apache ab压测工具

什么是ab

ab是用于对Apache超文本传输协议(HTTP)服务器进行基准测试的工具

ab(apache benchmark)安装

yum -y install httpd-tools

使用示例

 ab -n 1000 -c 200 http://localhost:3001/
 ## 模拟1000个请求,由200个用户

-n: 表示1000请求数
-c: 表示200并发数

结果说明

$ ab -n 1000 -c 200 https://www.baidu.com/
## apache版本信息
This is ApacheBench, Version 2.3 <$Revision: 1843412 $>
Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
Licensed to The Apache Software Foundation, http://www.apache.org/
…………
## 服务器软件
Server Software:        BWS/1.1 
Server Hostname:        www.baidu.com
Server Port:            443
SSL/TLS Protocol:       TLSv1.2,ECDHE-RSA-AES128-GCM-SHA256,2048,128
Server Temp Key:        ECDH P-256 256 bits
TLS Server Name:        www.baidu.com

Document Path:          /
Document Length:        227 bytes

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

Connection Times (ms)
              min  mean[+/-sd] median   max
Connect:      106 1085 187.4   1110    1691
Processing:   132  382 141.2    323     706
Waiting:       27  375 138.5    322     690
Total:        317 1467 192.4   1453    1976

Percentage of the requests served within a certain time (ms)
  50%   1453
  66%   1555
  75%   1617
  80%   1650
  90%   1747
  95%   1784
  98%   1833
  99%   1863
 100%   1976 (longest request)
  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值