使用 AB 进行负载测试 ... 假失败请求(长度) - Load Testing with AB ... fake failed requests (length)

10/14 00:25
阅读数 0

问题:

To do some load testing, for my own curiosity, on my server I ran:为了做一些负载测试,出于我自己的好奇,我在我的服务器上运行:

ab -kc 50 -t 200 http://localhost/index.php

This opens up 50 keep-alive connections for 200 seconds and just slams my server with requests for index.php这会打开 50 个保持活动连接 200 秒,然后用对 index.php 的请求猛烈抨击我的服务器

In my results, I get:在我的结果中,我得到:

Concurrency Level:      50
Time taken for tests:   200.007 seconds
Complete requests:      33106
Failed requests:        32951
   (Connect: 0, Receive: 0, Length: 32951, Exceptions: 0)
Write errors:           0
Keep-Alive requests:    0
Total transferred:      1948268960 bytes
HTML transferred:       1938001392 bytes
Requests per second:    165.52 [#/sec] (mean)
Time per request:       302.071 [ms] (mean)
Time per request:       6.041 [ms] (mean, across all concurrent requests)
Transfer rate:          9512.69 [Kbytes/sec] received

Note the 32951 "failed" requests.请注意 32951 个“失败”的请求。 I cannot figure this out.我无法弄清楚这一点。

As the test was running, I was able to access my web site from my home computer perfectly, albeit page load times at the bottom of the page were reported as .5 instead of the usual .02.在测试运行时,我能够从我的家用计算机完美地访问我的网站,尽管页面底部的页面加载时间被报告为 0.5 而不是通常的 0.02。 However I never once had a failed request.但是我从来没有遇到过失败的请求。

So why is AB reporting that half of the connections fail?那么为什么 AB 报告一半的连接失败呢? And what does "Length: " mean in that context?在这种情况下,“长度:”是什么意思?


解决方案:

参考一: https://en.stackoom.com/question/2Qjy
参考二: https://stackoom.com/question/2Qjy
展开阅读全文
php
打赏
0
0 收藏
分享
加载中
更多评论
打赏
0 评论
0 收藏
0
分享
返回顶部
顶部