前往小程序,Get更优阅读体验!
立即前往
首页
学习
活动
专区
工具
TVP
发布
社区首页 >专栏 >使用ab做性能测试

使用ab做性能测试

作者头像
超级大猪
发布2019-11-22 00:13:32
4260
发布2019-11-22 00:13:32
举报
文章被收录于专栏:大猪的笔记大猪的笔记

安装ab

代码语言:javascript
复制
apt install -y apache2-utils

开始测试

代码语言:javascript
复制
ab -t 5 -c 1000 "http://127.0.0.1:8000/dynamic_hello?hello=yzh"
  • -t 持续的时间
  • -c 并发量

等待一会,出结果

结果分析

代码语言:javascript
复制
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)
Finished 1740 requests


Server Software:        
Server Hostname:        127.0.0.1
Server Port:            8000

Document Path:          /dynamic_hello?hello=yzh
Document Length:        17 bytes

Concurrency Level:      1000
Time taken for tests:   5.261 seconds
Complete requests:      1740 // 请求数
Failed requests:        0  // 失败数
Total transferred:      196880 bytes
HTML transferred:       31280 bytes
Requests per second:    330.76 [#/sec] (mean) // QPS
Time per request:       3023.304 [ms] (mean)  // 用户感受的平均响应时间
Time per request:       3.023 [ms] (mean, across all concurrent requests)  // 服务端每个请求的处理时间
Transfer rate:          36.55 [Kbytes/sec] received

Connection Times (ms)
              min  mean[+/-sd] median   max
Connect:        0  279 452.8      2    1034
Processing:   302  802 402.0    866    4229
Waiting:      280  695 372.7    731    4081
Total:        304 1082 732.1    869    5245

Percentage of the requests served within a certain time (ms)
  50%    869
  66%    909
  75%   1583
  80%   1939
  90%   2009
  95%   2638
  98%   2647
  99%   2649
 100%   5245 (longest request)

关注这几个指标就行了

本文参与 腾讯云自媒体分享计划,分享自作者个人站点/博客。
原始发表:2019-05-08 ,如有侵权请联系 cloudcommunity@tencent.com 删除

本文分享自 作者个人站点/博客 前往查看

如有侵权,请联系 cloudcommunity@tencent.com 删除。

本文参与 腾讯云自媒体分享计划  ,欢迎热爱写作的你一起参与!

评论
登录后参与评论
0 条评论
热度
最新
推荐阅读
目录
  • 安装ab
  • 开始测试
  • 结果分析
相关产品与服务
腾讯云服务器利旧
云服务器(Cloud Virtual Machine,CVM)提供安全可靠的弹性计算服务。 您可以实时扩展或缩减计算资源,适应变化的业务需求,并只需按实际使用的资源计费。使用 CVM 可以极大降低您的软硬件采购成本,简化 IT 运维工作。
领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档