You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by Qingshan Xie <xi...@yahoo.com> on 2006/08/10 07:26:02 UTC

[users@httpd] WebServer slower after turned on KeepAlive

Hi,All, 

   We have apache-2.0.54 installed on Solaris and
Linux boxes.  We did a bounch of Load-Test with
KeepAlive On or Off on multiple jpg, gif, text files. 
The test results are discourage.  The webServer has
slower response time when KeepAlive is On compared to
the condition when KeepAlive is Off.  Can someone tell
me what chould be wrong, or what is the trick to make
the KeepAlive function as expect?

Many Thanks, Q.Xie

__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


[users@httpd] WebServer slower after turned on KeepAlive

Posted by Joshua Slive <jo...@slive.ca>.
On 8/13/06, Qingshan Xie <xi...@yahoo.com> wrote:
> --- Joshua Slive <jo...@slive.ca> wrote:
> ......
> > Having a portion of children hanging out in
> keepalive
> > could hurt even if there are children free, because
> > it could cause more context switches/memory cache
> > misses when switching requests between children.
>
> I don't fully understand what you explained above.
> Could you explain more?

Having a bunch of unused processes hanging around could make it less
likely to hit a process that is pre-loaded in the processor cache, and
more likely to hit a process that has been swapped to disk-based mem
cache.  The first issue should be relatively minor, but the second
could be quite major if you don't have enough physical ram.

Joshua.

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] WebServer slower after turned on KeepAlive

Posted by Qingshan Xie <xi...@yahoo.com>.
--- Joshua Slive <jo...@slive.ca> wrote:
...... 
> Having a portion of children hanging out in
keepalive 
> could hurt even if there are children free, because 
> it could cause more context switches/memory cache 
> misses when switching requests between children.

I don't fully understand what you explained above. 
Could you explain more?

Many Thanks, Q.Xie 


__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] WebServer slower after turned on KeepAlive

Posted by Joshua Slive <jo...@slive.ca>.
On 8/12/06, Qingshan Xie <xi...@yahoo.com> wrote:
> Joshua,  I re-read your comment, have couple questions
> inserted below.  Could you please help me again?
>
> Thx, Q.Xie
>
> --- Joshua Slive <jo...@slive.ca> wrote:
> ......
> > If the load-testing clients are not using
> > keep-alives, the server will
> > almost certainly be slower with keep-alives turned
> > on, because a bunch
> > of your processes will be stuck waiting for requests
> > on keep-alive connections that never come.
>
>   I am not clear here.  Since our load-test kept
> sending the requests continually, the children with
> keep-alive connections should not be stuck in waiting
> for requests. Am I right?  still not clear why
> keep-alive slows down the performance?
>
>   I also think, if the number of free/available
> children is big engough, a portion of children being
> stuck waiting for requests on keep-alive connections
> should not slow down the performance, right?

I don't know anything about your load testing tools.  For example, is
the client using keepalives?  If not, turning them on on the server
will certainly be slower.   Even if the clients are using keepalives,
how many requests are they sending per connection?

Having a portion of children hanging out in keepalive could hurt even
if there are children free, because it could cause more context
switches/memory cache misses when switching requests between children.

>
> > ...... A better solution in development in 2.2/2.3
> > is the event mpm, which transfers keep-alive
> > processing to a separate thread where it doesn't tie
> > up the worker threads.
>
> Event mpm is really the one we are looking for.
> However, it seems still a experimental MPM.  Could you
> tell me how stable event mpm in 2.2/2.3?

I believe it is relatively stable in 2.2 as long as you aren't using ssl.

Joshua.

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] WebServer slower after turned on KeepAlive

Posted by Qingshan Xie <xi...@yahoo.com>.
Joshua,  Thanks a lot for you reply.

I also think about the possible explanation.
Theoretically, Without "KeepAlive On", Apache parent
will pick whatever needed number of multiple children
to handle multiple requests in parallel.  However, in
the condition of "KeepAlive On", a specific child,
which has the connection ESTABLISHED with the client,
will handle the multiple requests from the same client
sequentially. It slows down the performance in the
condition of large number of objects/files in a single
hit.  In the opposite, the "KeepAlive Off" would
perform faster since Apache will handle multiple
requests by multiple children simultaneously in
parallel.  Do you think the above explanation makes
sense?

Thx, Q.Xie


--- Joshua Slive <jo...@slive.ca> wrote:

> On 8/10/06, Qingshan Xie <xi...@yahoo.com> wrote:
> > Hi,All,
> >
> >    We have apache-2.0.54 installed on Solaris and
> > Linux boxes.  We did a bounch of Load-Test with
> > KeepAlive On or Off on multiple jpg, gif, text
> files.
> > The test results are discourage.  The webServer
> has
> > slower response time when KeepAlive is On compared
> to
> > the condition when KeepAlive is Off.  Can someone
> tell
> > me what chould be wrong, or what is the trick to
> make
> > the KeepAlive function as expect?
> 
> That's the beauty of load testing software.  It all
> depends on how
> things are measured.
> 
> If the load-testing clients are not using
> keep-alives, the server will
> almost certainly be slower with keep-alives turned
> on, because a bunch
> of your processes will be stuck waiting for requests
> on keep-alive
> connections that never come.  Even if the clients
> *are* using
> keep-alives, you could see the same effect (to a
> lesser degree) if
> they don't balance perfectly with the server.
> 
> In the real world, people with very busy servers and
> a limitted
> MaxClients (because of memory issues, perhaps) often
> need to turn down
> KeepAliveTimeout to keep up with the load.  A better
> solution in
> development in 2.2/2.3 is the event mpm, which
> transfers keep-alive
> processing to a separate thread where it doesn't tie
> up the worker
> threads.
> 
> Joshua.
> 
>
---------------------------------------------------------------------
> The official User-To-User support forum of the
> Apache HTTP Server Project.
> See <URL:http://httpd.apache.org/userslist.html> for
> more info.
> To unsubscribe, e-mail:
> users-unsubscribe@httpd.apache.org
>    "   from the digest:
> users-digest-unsubscribe@httpd.apache.org
> For additional commands, e-mail:
> users-help@httpd.apache.org
> 
> 


__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] WebServer slower after turned on KeepAlive

Posted by Qingshan Xie <xi...@yahoo.com>.
Joshua,  I re-read your comment, have couple questions
inserted below.  Could you please help me again?

Thx, Q.Xie

--- Joshua Slive <jo...@slive.ca> wrote:
...... 
> If the load-testing clients are not using 
> keep-alives, the server will
> almost certainly be slower with keep-alives turned
> on, because a bunch
> of your processes will be stuck waiting for requests
> on keep-alive connections that never come.  

  I am not clear here.  Since our load-test kept
sending the requests continually, the children with
keep-alive connections should not be stuck in waiting
for requests. Am I right?  still not clear why
keep-alive slows down the performance?

  I also think, if the number of free/available
children is big engough, a portion of children being
stuck waiting for requests on keep-alive connections
should not slow down the performance, right?

> ...... A better solution in development in 2.2/2.3 
> is the event mpm, which transfers keep-alive
> processing to a separate thread where it doesn't tie
> up the worker threads.

Event mpm is really the one we are looking for. 
However, it seems still a experimental MPM.  Could you
tell me how stable event mpm in 2.2/2.3?

Many Thanks, 
Q.Xie

> 
> Joshua.
> 
>
---------------------------------------------------------------------
> The official User-To-User support forum of the
> Apache HTTP Server Project.
> See <URL:http://httpd.apache.org/userslist.html> for
> more info.
> To unsubscribe, e-mail:
> users-unsubscribe@httpd.apache.org
>    "   from the digest:
> users-digest-unsubscribe@httpd.apache.org
> For additional commands, e-mail:
> users-help@httpd.apache.org
> 
> 


__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] WebServer slower after turned on KeepAlive

Posted by Joshua Slive <jo...@slive.ca>.
On 8/10/06, Qingshan Xie <xi...@yahoo.com> wrote:
> Hi,All,
>
>    We have apache-2.0.54 installed on Solaris and
> Linux boxes.  We did a bounch of Load-Test with
> KeepAlive On or Off on multiple jpg, gif, text files.
> The test results are discourage.  The webServer has
> slower response time when KeepAlive is On compared to
> the condition when KeepAlive is Off.  Can someone tell
> me what chould be wrong, or what is the trick to make
> the KeepAlive function as expect?

That's the beauty of load testing software.  It all depends on how
things are measured.

If the load-testing clients are not using keep-alives, the server will
almost certainly be slower with keep-alives turned on, because a bunch
of your processes will be stuck waiting for requests on keep-alive
connections that never come.  Even if the clients *are* using
keep-alives, you could see the same effect (to a lesser degree) if
they don't balance perfectly with the server.

In the real world, people with very busy servers and a limitted
MaxClients (because of memory issues, perhaps) often need to turn down
KeepAliveTimeout to keep up with the load.  A better solution in
development in 2.2/2.3 is the event mpm, which transfers keep-alive
processing to a separate thread where it doesn't tie up the worker
threads.

Joshua.

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org