【求助】apache的ab工具测试结果与实际效果不符

xy373018274 2017-12-27 10:01:23
apache的ab工具测试结果与实际效果不符

本机和云服务器,都是用的wamp的架构
在调测的时候,基本上就是瞬间返回结果。

然后问题来了,
1 本机测试 我从127.0.0.1开始,100并发开始测试,发现很慢,然后降低并发数到80,到8,到1,结果发现请求1并发1的时候也是5秒………但是测试百度的网址效果是正常的。
2 在云服务器上测试本机127也是5秒的,1请求1并发。

如果是1请求1并发,那就和我在本地浏览器模拟应该是一样的,那为什么浏览器是瞬间返回结果,而ab的反而是5秒的返回时间呢?到底是我的代码问题,还是测试工具使用的问题?

求指点,谢谢!

-------------------------------------并发1的结果--------------------------------------------------------

C:\wamp3\bin\apache\apache2.4.23\bin>ab -n 1 -c 1 http://127.0.0.1/
This is ApacheBench, Version 2.3 <$Revision: 1748469 $>
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).....done


Server Software: Apache/2.4.23
Server Hostname: 127.0.0.1
Server Port: 80

Document Path: /
Document Length: 43 bytes

Concurrency Level: 1
Time taken for tests: 5.513 seconds
Complete requests: 1
Failed requests: 0
Non-2xx responses: 1
Total transferred: 429 bytes
HTML transferred: 43 bytes
Requests per second: 0.18 [#/sec] (mean)
Time per request: 5513.316 [ms] (mean)
Time per request: 5513.316 [ms] (mean, across all concurrent requests)
Transfer rate: 0.08 [Kbytes/sec] received

Connection Times (ms)
min mean[+/-sd] median max
Connect: 1 1 0.0 1 1
Processing: 5511 5511 0.0 5511 5511
Waiting: 11 11 0.0 11 11
Total: 5512 5512 0.0 5512 5512



-------------------------------------并发10的结果--------------------------------------------------------

C:\wamp3\bin\apache\apache2.4.23\bin>ab -n 10 -c 10 http://127.0.0.1/
This is ApacheBench, Version 2.3 <$Revision: 1748469 $>
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).....done


Server Software: Apache/2.4.23
Server Hostname: 127.0.0.1
Server Port: 80

Document Path: /
Document Length: 43 bytes

Concurrency Level: 10
Time taken for tests: 5.587 seconds
Complete requests: 10
Failed requests: 0
Non-2xx responses: 10
Total transferred: 4290 bytes
HTML transferred: 430 bytes
Requests per second: 1.79 [#/sec] (mean)
Time per request: 5587.319 [ms] (mean)
Time per request: 558.732 [ms] (mean, across all concurrent requests)
Transfer rate: 0.75 [Kbytes/sec] received

Connection Times (ms)
min mean[+/-sd] median max
Connect: 0 0 0.4 0 1
Processing: 5514 5554 19.0 5556 5581
Waiting: 15 54 19.0 56 81
Total: 5514 5554 19.2 5556 5582

Percentage of the requests served within a certain time (ms)
50% 5556
66% 5563
75% 5564
80% 5574
90% 5582
95% 5582
98% 5582
99% 5582
100% 5582 (longest request)
...全文
1263 回复 打赏 收藏 转发到动态 举报
写回复
用AI写文章
回复
切换为时间正序
请发表友善的回复…
发表回复

24,922

社区成员

发帖
与我相关
我的任务
社区描述
Web 开发 Apache
社区管理员
  • Apache
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧