[prev in list] [next in list] [prev in thread] [next in thread] 

List:       apache-httpd-users
Subject:    [users@httpd] Apache KeepAlive seems to be blocking child processes and delaying requests
From:       Marc Murphy <mwmurphyx () yahoo ! com>
Date:       2013-05-25 1:46:26
Message-ID: 1369446386.17642.YahooMailNeo () web121705 ! mail ! ne1 ! yahoo ! com
[Download RAW message or body]

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 process

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:
http://s24.postimg.org/qdazev9rp/website_waterfall_local.png

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!

Marc


[Attachment #3 (text/html)]

<html><body><div style="color:#000; background-color:#fff; font-family:times new \
roman, new york, times, serif;font-size:12pt">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.<br><div style="font-family: times new roman, new york, \
times, serif; font-size: 12pt;"><div style="font-family: times new roman, new york, \
times, serif; font-size: 12pt;"><div class="y_msg_container"><div \
id="yiv6205463781"><div><div \
style="color:#000;background-color:#fff;font-family:times new roman, new york, times, \
serif;font-size:12pt;"><div style="font-family:times new roman, new york, times, \
serif;font-size:12pt;"><div style="font-family:times new roman, new york, times, \
serif;font-size:12pt;"><div class="yiv6205463781y_msg_container"><div \
id="yiv6205463781"><div><div \
style="color:#000;background-color:#fff;font-family:times new roman, new york, times, \
serif;font-size:12pt;"><div  style="color:rgb(0, 0, \
0);font-size:16px;font-family:times new roman, new york, times, \
serif;background-color:transparent;font-style:normal;"><br></div><div \
style="color:rgb(0, 0, 0);font-size:16px;font-family:times new roman, new york, \
times, serif;background-color:transparent;font-style:normal;">Here's the \
situation:<br></div><div style="color:rgb(0, 0, 0);font-size:16px;font-family:times \
new roman, new york, times, \
serif;background-color:transparent;font-style:normal;"><br></div><div \
style="color:rgb(0, 0, 0);font-size:16px;font-family:times new roman, new york, \
times, serif;background-color:transparent;font-style:normal;">Firefox allows 6 \
persistent connections.</div><div style="color:rgb(0, 0, \
0);font-size:16px;font-family:times new roman, new york, times, \
serif;background-color:transparent;font-style:normal;">KeepAlive in on with a Timeout \
of 5 s</div> 6 requests are made<br>the 7th request is blocked until the 6 requests \
are done<br>the 7th request waits for 1 s more than it should... I believe Apache is \
spawning a child process<br><br>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.<br><br>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.<br><br>For a pic of the \
problem:<br>http://s24.postimg.org/qdazev9rp/website_waterfall_local.png<br><br>I \
don't have any of what I believe  the the 1s spawning delay when I set KeepAlive \
Off.<br><br>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.<br><br>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!<br><br>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.<br><br>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.<br><br>Thanks for any insights you can \
offer!<br><br>Marc<br></div></div></div><br><br></div> </div> </div>  \
</div></div></div><br><br></div> </div> </div>  </div></body></html>



[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic