本文分享自华为云社区《【高并发】如何使用ab进行并发与压力测试?》,作者:冰 河。
今天给大家分享一篇如何使用ab进行并发与压力测试的文章。
工具使用示例如下:
ab -n 1000 -c 50 http://localhost:8080/test
命令说明如下:
运行示例如下:
[root@localhost] ab -n 1000 -c 50 http://localhost:8080/test
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/
Benchmarking localhost (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:
Server Hostname: localhost
Server Port: 8080
Document Path: /test
Document Length: 4 bytes
Concurrency Level: 50
Time taken for tests: 0.792 seconds
Complete requests: 1000
Failed requests: 0
Total transferred: 136000 bytes
HTML transferred: 4000 bytes
Requests per second: 1262.90 [#/sec] (mean)
Time per request: 39.591 [ms] (mean)
Time per request: 0.792 [ms] (mean, across all concurrent requests)
Transfer rate: 167.73 [Kbytes/sec] received
Connection Times (ms)
min mean[+/-sd] median max
Connect: 0 0 0.7 0 12
Processing: 3 38 26.0 31 186
Waiting: 2 26 21.5 23 175
Total: 3 38 26.0 32 186
Percentage of the requests served within a certain time (ms)
50% 32
66% 36
75% 42
80% 44
90% 60
95% 85
98% 151
99% 156
100% 186 (longest request)
返回结果数据说明如下:
版权说明 : 本文为转载文章, 版权归原作者所有 版权申明
原文链接 : https://huaweicloud.blog.csdn.net/article/details/124195379
内容来源于网络,如有侵权,请联系作者删除!