并发数 - Apache的ab测试中,10个并发是有多少请求量?

【字号: 日期:2022-07-30浏览:50作者:雯心

问题描述

使用Apache自带的ab测试工具,10个并发是会有多少请求量,并发量是怎么算的,是1秒钟的请求数还是多长时间内的请求算并发

D:wampbinapacheapache2.4.9bin>ab -n 100 -c 10 http://www.baidu.com/This is ApacheBench, Version 2.3 <$Revision: 1554214 $>Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/Licensed to The Apache Software Foundation, http://www.apache.org/Benchmarking www.baidu.com (be patient).....doneServer Software:BWS/1.1Server Hostname:www.baidu.comServer Port: 80Document Path: /Document Length:52980 bytesConcurrency Level: 10Time taken for tests: 12.121 secondsComplete requests: 100Failed requests:99 (Connect: 0, Receive: 0, Length: 99, Exceptions: 0)Total transferred: 5368249 bytesHTML transferred: 5300179 bytesRequests per second: 8.25 [#/sec] (mean)Time per request: 1212.069 [ms] (mean)Time per request: 121.207 [ms] (mean, across all concurrent requests)Transfer rate: 432.52 [Kbytes/sec] receivedConnection Times (ms) min mean[+/-sd] median maxConnect: 25 119 522.7 27 3103Processing: 56 1067 1384.7 246 3691Waiting: 27 207 603.1 84 3157Total: 87 1186 1431.0 273 3717Percentage of the requests served within a certain time (ms) 50% 273 66% 445 75% 3268 80% 3276 90% 3357 95% 3457 98% 3631 99% 3717 100% 3717 (longest request)D:wampbinapacheapache2.4.9bin>

这一句说明的是百度的平均并发量只有8.25?

Requests per second: 8.25 [#/sec] (mean)

问题解答

回答1:

10个并发就是瞬间10个请求到服务器上去,如果服务器处理的快,那么就继续,但是使用参数中有请求总数,其实就是以每次10个并发的方式将你设置的请求总数都压到服务器上去,看服务器多久可以处理完,计算平均每秒的响应情况

回答2:

你看到的每秒请求数很低,是因为很多网站都会针对你这样的测试判断为类CC攻击,会故意降低响应甚至屏蔽你的请求

相关文章: