简单的ab压测实践
其他
2020-03-26 17:11:17
阅读次数: 0
ab压测
安装环境
- ab -v 发现自己没安装
- yum -y install httpd-tools (-y参数可以省略找到安装包后的yes操作)
- 稍等一会安装成功 再次 ab -v 安装成功很好!
开始测试
- 遇事不决help ab -help
- 通过help我们知道两个常用参数 -n(发送请求总数) -c(用户数,并发数)
- 随便找个一言接口测试 ab -c 10 -n 100 https://v1.hitokoto.cn/?encode=json 回车车
- 结果分析
- 命令回显如下:
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 v1.hitokoto.cn (be patient).....done
Server Software:
Server Hostname: v1.hitokoto.cn
Server Port: 443
SSL/TLS Protocol: TLSv1.2,ECDHE-RSA-AES128-GCM-SHA256,2048,128
Document Path: /?encode=json
Document Length: 313 bytes
Concurrency Level: 10
Time taken for tests: 1.356 seconds
Complete requests: 100
Failed requests: 96
(Connect: 0, Receive: 0, Length: 96, Exceptions: 0)
Write errors: 0
Total transferred: 86855 bytes
HTML transferred: 31469 bytes
Requests per second: 73.74 [
Time per request: 135.611 [ms] (mean)
Time per request: 13.561 [ms] (mean, across all concurrent requests)
Transfer rate: 62.55 [Kbytes/sec] received
Connection Times (ms)
min mean[+/-sd] median max
Connect: 46 53 3.9 52 65
Processing: 52 64 14.0 61 120
Waiting: 52 64 14.0 60 120
Total: 99 117 15.8 113 178
Percentage of the requests served within a certain time (ms)
50% 113
66% 117
75% 120
80% 122
90% 125
95% 158
98% 174
99% 178
100% 178 (longest request)
发布了4 篇原创文章 ·
获赞 0 ·
访问量 67
转载自blog.csdn.net/qq_32450143/article/details/105065016