Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

So, in the past I've never had any problems with this app. All benchmarks had 100% success rate. Yesterday I set up nginx to server static content and pass on other requests to apache. Now, if I have 1 concurrent user (-c 1) then everything is fine. But it seems the more concurrent users I have, the more failed requests I get. Not a lot, but maybe about 10 or 15 out of 350. They're "length", whatever that means. Visiting the website with a browser, I don't have any problems at all. How can I find out the cause of these failed requests?

Here's part of my httpd.conf:

Timeout 20

KeepAlive Off

MaxKeepAliveRequests 100

<IfModule prefork.c>
StartServers 1
MinSpareServers 1
MaxSpareServers 3
ServerLimit 50
MaxClients 50
MaxRequestsPerChild  4000

<IfModule worker.c>
StartServers 1
MaxClients 50
MinSpareThreads     25
MaxSpareThreads     75 
ThreadsPerChild     25
MaxRequestsPerChild  0

Is there other info you need?

share|improve this question
we need more info. how's your httpd.conf regarding connections? probably, you need to tweak some parameters in httpd.conf. – Marco Ramos May 27 '10 at 14:21
I added the part of httpd.conf that probably matters. Is there anything else? – Matthew May 27 '10 at 14:29
up vote 1 down vote accepted

My guess is that you're hitting the MaxClients limit when you're benchmarking the site.

While benchmarking the site, try to see how many connections are established in port 80:

netstat -tnap | grep ":80" | grep -c ESTA

Repeat this command a couple of times while benchmarking the site. Probably you'll be hitting 50 established connections.

A rrdtool trending application (like Cacti, Munin or Ganglia) graphing the number of TCP connections is also good to debug this kind of problems as you can see the historic.

Hope this helps!

share|improve this answer

These "length" failures just mean that the content length (amount of data served by your application) for some of the tries did not match up with the length of the first request. So, if ab got 100 bytes the first time. and then recevied 150 bytes the next 9 times, it would report back with 9 length failure.

If you are serving dynamic content, these errors are expected and can be safely ignored.

The answer by Marco Ramos is not correct, there is no reason to do anything like running netstat.

Here's a better explaination from someone on Stackoverflow:

Load Testing with AB … fake failed requests (length)

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.