views:

2067

answers:

2

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

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. 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. However I never once had a failed request.

So why is AB reporting that half of the connections fail? And what does "Length: " mean in that context?

Thanks

+10  A: 

Nevermind. The "length failure" merely indicates that about half the time the length of the response was different.

Since the contents are dynamic, it's probably the session identifier or something like that.

Please delete this.

This is a decent question - mark yourself as the answer so someone else can see the answer if they're stuck!
Andy Mikula
Hey, I just ran into the same "problem" and am glad this answer was here. Thanx!
RNHurt
Me too! Can't they call it something besides a "failure"!?
scotts
Don't delete. This really helped me.
Deane
Thanks for the answer, I had exactly the same doubt.
Saiyine
A: 

Does your website have a load balancer? See my blog post on load testing with load balancers that might explain the "it works for me" situation in load testing.

Patrick Lightbody