apacheBench 总是给出错误的非 2xx 响应:

apacheBench always gives error Non-2xx responses:

我使用 apache bench 已经有一段时间了,直到现在它工作得很好。然而,今天我开始得到几个Non-2xx responses:。为了进一步调查,我尝试 运行 用一个简单的网站进行测试,所以我 运行:

ab -n 100 -c 10 http://www.yahoo.com/

这就是我得到的:

This is ApacheBench, Version 2.3 <$Revision: 1796539 $> Copyright 1996
Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/ Licensed to
The Apache Software Foundation, http://www.apache.org/

Benchmarking www.yahoo.com (be patient).....done


Server Software:        ATS 
Server Hostname:        www.yahoo.com    
Server Port:            80     
Document Path:          / 
Document Length:        8 bytes
Concurrency Level:      10 
Time taken for tests:   4.898 seconds
Complete requests:      100 
Failed requests:        0 
Non-2xx responses:      100 
Total transferred:      36875 bytes 
HTML transferred:       800 bytes 
Requests per second:    20.42 [#/sec] (mean) 
Time per request:       489.817 [ms] (mean) 
Time per request: 48.982 [ms] (mean, across all concurrent requests) 
Transfer rate:          7.35 [Kbytes/sec] received
Connection Times (ms)
             min  mean[+/-sd] median   max
Connect:       39   48   6.3     47      66
Processing:    50  416  89.3    415     521
Waiting:       49  254 121.0    261     512
Total:         93  464  92.1    460     575
Percentage of the requests served within a certain time (ms)
  50%    460
  66%    476
  75%    511
  80%    541
  90%    569
  95%    572
  98%    574
  99%    575
  100%    575 (longest request)

如输出所示,即使使用外部 url,我也会得到 100% 非 2xx 响应。有谁知道我该如何解决这个问题?

谢谢!

可能是因为在访问 Yahoo.com 时他们会重定向您,因此您会得到 30 倍的响应,而不是直接的 20 倍。