apacheconcurrencyapachebenchparallel-testing

apacheBench always gives error Non-2xx responses:


I have been working with apache bench for a while now and until now it worked just fine. However, today I started getting several Non-2xx responses:. In order to investigate further, I tried to run a test with a simple website, so I run:

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

And this is what I got:

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)

As the output shows, even with an external url, I get 100% Non-2xx responses. Does anyone know how I could fix this?

Thank you!


Solution

  • It might be because when accessing Yahoo.com they are redirecting you, and therefore you'll get 30X responses and not 20X directly.