httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Marc Murphy <>
Subject [users@httpd] Apache KeepAlive seems to be blocking child processes and delaying requests
Date Sat, 25 May 2013 01:46:26 GMT
Hello, I am using Apache 2.2 mpm prefork and am having a problem with requests spawning child
processes. I am using Firefox on Ubuntu 11.04.

Here's the situation:

Firefox allows 6 persistent connections.
KeepAlive in on with a Timeout of 5 s
6 requests are made
the 7th request is blocked until the 6 requests are done
the 7th request waits for 1 s more than it should... I believe Apache is spawning a child

My issue is that I think that once the 6 requests are done, there should be 6 child processes
idle (because of KeepAlive). I would think that the 7th request should be served by one of
these 6 now idle child processes. Instead it seems like the 6 initial processes idle and the
7th must wait for a new child process to spawn.

Also, shouldn't the KeepAlive max count in the headers decrease for every request served by
the Apache child process? It seems that many requests are always at the initial max count
which I think means that the persistent connection is not being reused. It basically gets
used once and then is unavailable.

For a pic of the problem:

I don't have any of what I believe
 the the 1s spawning delay when I set KeepAlive Off.

If I create enough child processes to handle every request in parallel, I do not have any
problems however any pageload done within the KeepAlive timeout limit will require more child
processes... as if the originals are unresponsive.

Maybe I don't understand KeepAlive but as a test if I set my MaxClients to 1, subsequent requests
are delayed by the KeepAlive Timeout. I would think that the child process would be alive
to handle requests before the time out but instead it seems like the child process handles
a request and then will not handle another one until the keepalive timeout elapses!

I'm very confused about why KeepAlive is seeming to cause problems. Thought it would make
things more efficient by cutting down connection overhead on subsequent requests.

I believe my content-length headers are correct but heard they could be a reason for apache
processes to become
 unusable while they wait for data that doesn't come.

Thanks for any insights you can offer!

View raw message