Poor Apache 2 performance (relative to 1)

This is a discussion on Poor Apache 2 performance (relative to 1) within the Linux Web Servers forums, part of the Web Server and Related Forums category; Dear All, We have 4 (identical) machines (Solaris 9 512MB SunV100) that are behind a BIG-IP load balancer. Three (...


Go Back   Usenet Forums > Web Server and Related Forums > Linux Web Servers

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 07-04-2003
Michael
 
Posts: n/a
Default Poor Apache 2 performance (relative to 1)

Dear All,

We have 4 (identical) machines (Solaris 9 512MB SunV100) that are
behind a BIG-IP load balancer. Three (3) of the machines run Apache
1.3.27 the fourth runs Apache 2.0.45. Apache 2 has been configured to
use worker threads. The issue that we are having is that the
performance of Apache 2 is significantly lower (35%-50%) than Apache
1.
On Apache 1 we currently have MaxClients set to 1024, which is where
the machines start to run out of memory.
On Apache 2 we have the following setup
StartServers 100
MaxClients 4000
MinSpareThreads 100
MaxSpareThreads 100
ThreadsPerChild 100
MaxRequestsPerChild 0
The Apache 2 machine never seems to be in trouble with memory or cpu.
So I am wondering why it does not seem to be able to keep up with
Apache 1. In theory we should be able to serve more users per MByte
of memory with Apache 2, but this is not proving to be the case. Can
anyone suggest a configuration change that may help??

Cheers,

Michael.
  #2 (permalink)  
Old 07-04-2003
Joshua Slive
 
Posts: n/a
Default Re: Poor Apache 2 performance (relative to 1)

michaelb@championdata.com.au (Michael) wrote in message news:<d55785d7.0307031921.7bb6dcd5@posting.google. com>...
> On Apache 1 we currently have MaxClients set to 1024, which is where
> the machines start to run out of memory.
> On Apache 2 we have the following setup
> StartServers 100
> MaxClients 4000
> MinSpareThreads 100
> MaxSpareThreads 100
> ThreadsPerChild 100
> MaxRequestsPerChild 0
> The Apache 2 machine never seems to be in trouble with memory or cpu.
> So I am wondering why it does not seem to be able to keep up with
> Apache 1. In theory we should be able to serve more users per MByte
> of memory with Apache 2, but this is not proving to be the case. Can
> anyone suggest a configuration change that may help??


I don't think that configuration makes any sense. You should be seeing
complaints in the error_log.

For example, you are starting StartServers*ThreadsPerChild threads
at startup. That is 10,000! which is greater than MaxClients.

Plus you also have MinSpareThreads=MaxSpareThreads, which means you are
forcing Apache to constantly keep EXACTLY 100 idle threads.

Finally, if your 1.3 machines tend to run out of memory at 1024 processes,
then asking for 4000 clients on 2.0 may be streching it. Yes, threads are
more efficient than processes, but I'm not sure they are that much more
efficient.

See: http://httpd.apache.org/docs-2.0/mod/worker.html

Try something like this:
StartServers 5
MaxClients 2000
MinSpareThreads 25
MaxSpareThreads 200
ThreadsPerChild 100
MaxRequestsPerChild 0

And make sure you monitor the memory usage to assure you aren't swapping.

Joshua.
  #3 (permalink)  
Old 07-08-2003
Michael
 
Posts: n/a
Default Re: Poor Apache 2 performance (relative to 1)

google@slive.ca (Joshua Slive) wrote in message news:<916ecaf4.0307040638.2282af7e@posting.google. com>...
> michaelb@championdata.com.au (Michael) wrote in message news:<d55785d7.0307031921.7bb6dcd5@posting.google. com>...
> > On Apache 1 we currently have MaxClients set to 1024, which is where
> > the machines start to run out of memory.
> > On Apache 2 we have the following setup
> > StartServers 100
> > MaxClients 4000
> > MinSpareThreads 100
> > MaxSpareThreads 100
> > ThreadsPerChild 100
> > MaxRequestsPerChild 0
> > The Apache 2 machine never seems to be in trouble with memory or cpu.
> > So I am wondering why it does not seem to be able to keep up with
> > Apache 1. In theory we should be able to serve more users per MByte
> > of memory with Apache 2, but this is not proving to be the case. Can
> > anyone suggest a configuration change that may help??

>
> I don't think that configuration makes any sense. You should be seeing
> complaints in the error_log.
>
> For example, you are starting StartServers*ThreadsPerChild threads
> at startup. That is 10,000! which is greater than MaxClients.
>
> Plus you also have MinSpareThreads=MaxSpareThreads, which means you are
> forcing Apache to constantly keep EXACTLY 100 idle threads.
>
> Finally, if your 1.3 machines tend to run out of memory at 1024 processes,
> then asking for 4000 clients on 2.0 may be streching it. Yes, threads are
> more efficient than processes, but I'm not sure they are that much more
> efficient.
>
> See: http://httpd.apache.org/docs-2.0/mod/worker.html
>
> Try something like this:
> StartServers 5
> MaxClients 2000
> MinSpareThreads 25
> MaxSpareThreads 200
> ThreadsPerChild 100
> MaxRequestsPerChild 0
>
> And make sure you monitor the memory usage to assure you aren't swapping.
>
> Joshua.



Joshua,

Thanks for the input. You are right that the values of the parameters
do not make sense. The correct values are:
StartServers 100
ServerLimit 100
MaxClients 6400
MinSpareThreads 10
MaxSpareThreads 100
ThreadsPerChild 64
MaxRequestsPerChild 0

However the problem is not so much with the configuration of the
worker threads but the performance in general. Apache 2 performance
is still a long way from Apache 1. Note that with the above
configuration the machine has around 70MBytes free memory, and CPU
utilisation is low (20-30 %). I get the feeling that I am missing
something.

Thanks,

Michael.
  #4 (permalink)  
Old 07-08-2003
Joshua Slive
 
Posts: n/a
Default Re: Poor Apache 2 performance (relative to 1)

michaelb@championdata.com.au (Michael) wrote in message news:<d55785d7.0307071800.3fd8cfb1@posting.google. com>...
> Thanks for the input. You are right that the values of the parameters
> do not make sense. The correct values are:
> StartServers 100
> ServerLimit 100
> MaxClients 6400
> MinSpareThreads 10
> MaxSpareThreads 100
> ThreadsPerChild 64
> MaxRequestsPerChild 0
>
> However the problem is not so much with the configuration of the
> worker threads but the performance in general. Apache 2 performance
> is still a long way from Apache 1. Note that with the above
> configuration the machine has around 70MBytes free memory, and CPU
> utilisation is low (20-30 %). I get the feeling that I am missing
> something.


I am not an expert in high-performance web serving, but I can make a
couple comments:

1. If apache 1.3 can handle around 1024 clients in your setup, expecting
apache 2 to handle 6400 seems unreasonable. Just the context switching
alone could be deadly. Try bringing that back down to the 1024 range
and then increasing it slowly.

2. Unless this server is instantly hit with 6400 clients the moment it
starts, you are asking for a ton of thrashing at start-up. The
server starts 6400 threads, and then must kill them all until only
100 are free. I'd suggest setting StartServers much lower and
MaxSpareThreads much higher.

3. To figure out what is really going wrong, you may need to do
substantially more analysis. Just saying "performance is 35-50% lower"
is practically meaningless. Are you talking about hits/second? With
the same number of simultaneous clients? What kind of load? What
kind of content? What kind of network? What does your server-status
display look like? etc...

Joshua.
  #5 (permalink)  
Old 07-09-2003
Paul Rubin
 
Posts: n/a
Default Re: Poor Apache 2 performance (relative to 1)

michaelb@championdata.com.au (Michael) writes:
> The network consists of 4 identical machines that are being used to
> host a live sports site, the site provides information about current
> games in progress. The machines only serve up the same static html.


If you're only serving static html, why not use Tux or thttpd or
something like that instead of Apache?
 


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT +1. The time now is 11:05 PM.


Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.0.0