http 压测工具、性能测试工具ab

ab  

(ubuntu) 软件安装:

 sudo apt install -y apache2-utils

-n  一共多少个请求    (-n 10000 就是发1万个请求, -n 1000000 就是发 100万的请求)

-c 多少个并发  (同时发多少个, 默认是一个, -c 5 表示同时发5个请求

 

Requests per second 表示每秒处理多少请求

下面

Requests per second:    3287.11    

表示每秒处理3287 个请求 (这就是性能测试)

Time per request:       0.304 [ms] (mean)

表示每个请求的平均处理事件 0.304 毫秒

完整压测命令: ab -n 20000  http://127.0.0.1:8080/

curl   http://127.0.0.1:8080
<html>
<head>
  <title>libevent http server </title>
</head>
<body>
  <h1>libevent http server start success</h1>
</body>
</html>



Usage: ab [options] [http[s]://]hostname[:port]/path




ab -n 20000  http://127.0.0.1:8080/ 
This is ApacheBench, Version 2.3 <$Revision: 1807734 $>
Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
Licensed to The Apache Software Foundation, http://www.apache.org/

Benchmarking 127.0.0.1 (be patient)
Completed 2000 requests
Completed 4000 requests
Completed 6000 requests
Completed 8000 requests
Completed 10000 requests
Completed 12000 requests
Completed 14000 requests
Completed 16000 requests
Completed 18000 requests
Completed 20000 requests
Finished 20000 requests


Server Software:        
Server Hostname:        127.0.0.1
Server Port:            8080

Document Path:          /
Document Length:        130 bytes

Concurrency Level:      1
Time taken for tests:   6.084 seconds
Complete requests:      20000
Failed requests:        0
Total transferred:      3880000 bytes
HTML transferred:       2600000 bytes
Requests per second:    3287.11 [#/sec] (mean)
Time per request:       0.304 [ms] (mean)
Time per request:       0.304 [ms] (mean, across all concurrent requests)
Transfer rate:          622.75 [Kbytes/sec] received

Connection Times (ms)
              min  mean[+/-sd] median   max
Connect:        0    0   0.6      0      28
Processing:     0    0   0.3      0      34
Waiting:        0    0   0.3      0      34
Total:          0    0   0.6      0      34

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

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

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值