0
$ curl -s -D - https://www.google.com/ -o /dev/null
HTTP/1.1 200 OK
Date: Thu, 29 Oct 2015 05:33:13 GMT
Expires: -1
Cache-Control: private, max-age=0
Content-Type: text/html; charset=ISO-8859-1
P3P: CP="This is not a P3P policy! See http://www.google.com/support/accounts/bin/answer.py?hl=en&answer=151657 for more info."
Server: gws
X-XSS-Protection: 1; mode=block
X-Frame-Options: SAMEORIGIN
Set-Cookie: PREF=ID=1111111111111111:FF=0:TM=1446096793:LM=1446096793:V=1:S=LVeGIvKogvfq6VHi; expires=Thu, 31-Dec-2015 16:02:17 GMT; path=/; domain=.google.com
Set-Cookie: NID=72=sAIx-8ox3_AVxn6ymUjBsKzSmAXLwjNRTcV4Cj9ob1YmLkFc-lSJKvRK1kNdn1lIGruh-wH1_vctiRzKSFTG7IkJHSrVY_At_QbacsYgiI_8EOpMLe2cRIxXINj27DVpgnijGx7tKT1TCDirrunO3Bu0D4DVXz3lB0f42ZyJqOCtOJX2hprvbOOc8P8; expires=Fri, 29-Apr-2016 05:33:13 GMT; path=/; domain=.google.com; HttpOnly
Alternate-Protocol: 443:quic,p=1
Alt-Svc: quic="www.google.com:443"; p="1"; ma=600,quic=":443"; p="1"; ma=600
Accept-Ranges: none
Vary: Accept-Encoding
Transfer-Encoding: chunked

but Apache Bench has errors for all but one request:

$ ab -n 5 https://www.google.com/
This is ApacheBench, Version 2.3 <$Revision: 1528965 $>
Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
Licensed to The Apache Software Foundation, http://www.apache.org/

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


Server Software:        gws
Server Hostname:        www.google.com
Server Port:            443
SSL/TLS Protocol:       TLSv1.2,ECDHE-RSA-AES128-GCM-SHA256,2048,128

Document Path:          /
Document Length:        18922 bytes

Concurrency Level:      1
Time taken for tests:   1.773 seconds
Complete requests:      5
Failed requests:        4
   (Connect: 0, Receive: 0, Length: 4, Exceptions: 0)
Total transferred:      99378 bytes
HTML transferred:       94606 bytes
Requests per second:    2.82 [#/sec] (mean)
Time per request:       354.578 [ms] (mean)
Time per request:       354.578 [ms] (mean, across all concurrent requests)
Transfer rate:          54.74 [Kbytes/sec] received

Connection Times (ms)
              min  mean[+/-sd] median   max
Connect:      158  179  40.8    162     252
Processing:   132  176  79.0    148     316
Waiting:       81  118  80.5     83     262
Total:        292  354 119.5    310     567

Percentage of the requests served within a certain time (ms)
  50%    299
  66%    321
  75%    321
  80%    567
  90%    567
  95%    567
  98%    567
  99%    567
 100%    567 (longest request)

Why does ab have errors?

Paul Draper
  • 78,542
  • 46
  • 206
  • 285

2 Answers2

1

AB has categorized these as length errors because it expects the responses to be of the same length. Google probably has some kind of dynamic content being returned on their homepage.

Load Testing with AB ... fake failed requests (length)

Community
  • 1
  • 1
Quinto
  • 333
  • 3
  • 7
1

Add a -l to the command

It tells Apache Bench to not expect constant length for every response. This should work:

ab -l -n 5 https://www.google.com/

Output:

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

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


Server Software:        gws
Server Hostname:        www.google.com
Server Port:            443
SSL/TLS Protocol:       TLSv1.2,ECDHE-ECDSA-CHACHA20-POLY1305,256,256
TLS Server Name:        www.google.com

Document Path:          /
Document Length:        Variable

Concurrency Level:      1
Time taken for tests:   0.433 seconds
Complete requests:      5
Failed requests:        0
Total transferred:      67064 bytes
HTML transferred:       62879 bytes
Requests per second:    11.55 [#/sec] (mean)
Time per request:       86.588 [ms] (mean)
Time per request:       86.588 [ms] (mean, across all concurrent requests)
Transfer rate:          151.27 [Kbytes/sec] received

Connection Times (ms)
              min  mean[+/-sd] median   max
Connect:       20   20   1.0     20      22
Processing:    63   66   2.7     67      69
Waiting:       62   65   2.8     66      68
Total:         83   86   3.3     87      91

Percentage of the requests served within a certain time (ms)
  50%     85
  66%     89
  75%     89
  80%     91
  90%     91
  95%     91
  98%     91
  99%     91
 100%     91 (longest request)
Dojo
  • 5,374
  • 4
  • 49
  • 79