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

时间:2017-12-11 14:57:08

标签: apache concurrency apachebench parallel-testing

我一直在使用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)

如输出所示,即使使用外部网址,我也会获得 100%非2xx响应。有谁知道我怎么解决这个问题?

谢谢!

1 个答案:

答案 0 :(得分:2)

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

相关问题