You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by Nick De Decker <ni...@i-vision.be> on 2002/04/09 16:47:02 UTC

slow apache 2.0

Hello,

I'm testing apache 2.0 but i'm having trouble with it.
Benchmarks show very slow results when the number of concurrent users get
high.
i tested the prefork/worker settings but nothing seems to help.
tested with ab :
ab -n 10000 -c 1000 http://192.168.1.253/index.html (978 bytes page)

apache 1.3.24 => 1036 requests per second, response times of 110 ms
apache 2.0.35 => 68 requests per second, average response time of 15000 ms.

So why did the make apache 2.0 so slow ?  3 years of work for a server
that's  100 slower ?

Help me out please,

Nick De Decker



---------------------------------------------------------------------
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
For additional commands, e-mail: users-help@httpd.apache.org


Re: slow apache 2.0

Posted by Austin Gonyou <au...@coremetrics.com>.
Have you tried not using su-exec?

On Tue, 2002-04-09 at 11:51, Nick De Decker wrote:
> Hello again,
> 
> These are my current worker settings (defaults from standard httpd.conf)
> 
> StartServers         2
> MaxClients         150
> MinSpareThreads     25
> MaxSpareThreads     75
> ThreadsPerChild     25
> MaxRequestsPerChild  0
> 
> => With these settings apache 2.0 kicks ass, but only if concurrent
> requests
> is lower then 26
> 26 => 1000 per second
> 27 => 50 per second
> 
> I still have to install flood but haven't installed cvs for the moment,
> can
> i find tarballs somewhere ?
> Ab wont be the best benchmark test, but one must admit that the
> performance
> drop between 26 en 27 concurrent connections is horrible.
> 
> System : linux 2.4.18 / duron 1000 / 512 mb sdram / udma100 hd
> Apache got compiled with following settings :
> 
> ./configure \
> --enable-layout=Apache \
> --enable-so \
> --with-mpm=worker \
> --enable-ssl \
> --with-ssl=/usr/include/openssl \
> --enable-mime-magic \
> --enable-expires \
> --enable-headers \
> --enable-usertrack \
> --enable-http \
> --enable-dav \
> --enable-info \
> --enable-rewrite \
> --enable-speling \
> --enable-auth-anon \
> --enable-cgi \
> --enable-cgid \
> --enable-suexec \
> --with-suexec-caller=apache \
> --with-suexec-docroot=/iVision/users \
> --with-suexec-uidmin=1000 \
> --with-suexec-gidmin=1000 \
> --with-suexec-safepath=/usr/bin:/bin:/iVision/bin:/usr/local/bin
> 
> 
> Nick
> 
> ----- Original Message -----
> From: "Aaron Bannert" <aa...@clove.org>
> To: <de...@httpd.apache.org>
> Sent: Tuesday, April 09, 2002 5:18 PM
> Subject: Re: slow apache 2.0
> 
> 
> > On Tue, Apr 09, 2002 at 04:47:02PM +0200, Nick De Decker wrote:
> > > I'm testing apache 2.0 but i'm having trouble with it.
> > > Benchmarks show very slow results when the number of concurrent
> users
> get
> > > high.
> > > i tested the prefork/worker settings but nothing seems to help.
> > > tested with ab :
> > > ab -n 10000 -c 1000 http://192.168.1.253/index.html (978 bytes page)
> >
> > Ab is not very good for testing concurrency. Check out flood for
> > somewhat better concurrency (http://httpd.apache.org/test/flood/).
> >
> > Also, keep in mind that although you'll see better scalability
> > with the worker MPM over the "classic" prefork MPM, the biggest
> > improvement will be in memory requirements. I've run 300+ threads
> > on my solaris 8 box while only consuming around 20MB.
> >
> > -aaron
> >
> 
-- 
Austin Gonyou
Systems Architect, CCNA
Coremetrics, Inc.
Phone: 512-698-7250
email: austin@coremetrics.com

"It is the part of a good shepherd to shear his flock, not to skin it."
Latin Proverb

Re: slow apache 2.0

Posted by Brian Pane <bp...@pacbell.net>.
Nick De Decker wrote:

>Hello again,
>
>These are my current worker settings (defaults from standard httpd.conf)
>
>StartServers         2
>MaxClients         150
>MinSpareThreads     25
>MaxSpareThreads     75
>ThreadsPerChild     25
>MaxRequestsPerChild  0
>
>=> With these settings apache 2.0 kicks ass, but only if concurrent requests
>is lower then 26
>26 => 1000 per second
>27 => 50 per second
>
>I still have to install flood but haven't installed cvs for the moment, can
>i find tarballs somewhere ?
>Ab wont be the best benchmark test, but one must admit that the performance
>drop between 26 en 27 concurrent connections is horrible.
>

I've managed to recreate this scenario with the worker MPM on Linux.
By instrumenting the worker code, one thing I've found is that sometimes
the file descriptor queue in a child process can become full (causing the
listener to block, and the just-accepted connection to sit in limbo for
a while) in conditions where the server as a whole (across all child
processes) has plenty of idle threads.

--Brian




Re: slow apache 2.0

Posted by Justin Erenkrantz <je...@apache.org>.
On Tue, Apr 09, 2002 at 06:51:36PM +0200, Nick De Decker wrote:
> I still have to install flood but haven't installed cvs for the moment, can
> i find tarballs somewhere ?

http://www.apache.org/dist/httpd/flood-0.4.tar.gz

HTH.  -- justin

resolving SSL with mod_ssl.so

Posted by David Hill <dd...@zk3.dec.com>.
Hi,
    Building 2.0.40 on Tru64 I am seeing issues with building a resolved
mod_ssl.so.

I am using OpenSSL with the SSL libs built static. I get messages about
unresolved symbols when loading mod_ssl. I chased it down but need some
advice on a real resolution.

As you all know, mod_ssl needs to resolve against -lss -lcrypto. What I am
seeing is that:

Configure:
*  correctly detects that SSL is desired,
* finds the libs in the right place (I specify the location),
* knows that additional libraries, -lssl and -lcrypto are needed.
* adds -lssl and -lcrypto to EXTRA_LIBS

We are golden so far ... if we are building a static httpd, but I want to
build apache DSO.

When linking http, I do see the EXTRA_LIBS on the link line...

But... I am building mod_ssl.so, so there are no SSL calls in httpd to
resolve against, so in effect, the EXTRA_LIBS are ignored when linking
httpd. If my SSL libraries were built shared, then the linker would put a
runtime requirement into the httpd image that would load the SSL libs, but
my SSL libs are static.

So, normally I would expect that the link command creating mod_ssl.so would
include the needed EXTRA_LIBS, but I don't see any provision for this.

Hacking modules/ssl/modules.mk and adding -lssl -lcrypto, and makeing
mod_ssl.la I do end up with a fully resolved mod_ssl.so

Am I missing something dreadfully obvious here ?

It would seem to me that other than the static httpd case, resolving all DSO
against -lssl -lcrypto is not the right thing to do. If my SSL libs were
shared, then each of the DSO modules would load the SSL libs regardless if
they were needed or not. Given the size of the SSL libs that is a pain.

The right answer (?) would seem to be configure setting SSL_LIBS, and
somehow inserting them into the proper place depending on where they are
needed (httpd link or the mod_ssl.so link).

So any words of wisdom or thoughts from you build gurus out there ?

thanks,
    Dave Hill


Re: slow apache 2.0

Posted by "Victor J. Orlikowski" <vj...@dulug.duke.edu>.
Gah - 1009 threads on linux?
You must have a monster box, as each pthread in linux allocates around
2M worth of stack. This equates to around 2G worth of storage alone.

Silly question, but are you paging much during your tests?
(I'm guessing you have enough storage to handle this many threads, and
other suggestions have been more useful, but this is still a consideration.)

> > Settings now for worker mpm :
> >
> > ThreadLimit   1000
> > StartServers 1
> > Maxclients    2000
> > MinSpareThreads 25
> > MaxSpareThreads 75
> > ThreadsPerChild 1000
> > MaxRequestsPerChild 0
> >
> > => Strange thing is that with these settings a ps aux list a little 1009
> > apache processes, so these are no threads but childs ? strange ....
> >
> 
> This is linux wierdness. They are really threads andnot processes.
> 
> > Another thing is that with these settings the performance when load is low
> > that response times are higher and requests per seconds is 5 times lower
> > then with original settings.
> 
> 1000 is probably way to large for your test. Under light load, you are still chewing up
> lots of RAM and experiencing lots of context switching. The trick is to set
> ThreadsPerChild just right.. no greater than you need but large enough to handle the
> expected load.

Victor
-- 
Victor J. Orlikowski   | The Wall is Down, But the Threat Remains!
==================================================================
orlikowski@apache.org  | vjo@dulug.duke.edu | vjo@us.ibm.com

Re: slow apache 2.0

Posted by Bill Stoddard <bi...@wstoddard.com>.

> Hello,
>
> Settings now for worker mpm :
>
> ThreadLimit   1000
> StartServers 1
> Maxclients    2000
> MinSpareThreads 25
> MaxSpareThreads 75
> ThreadsPerChild 1000
> MaxRequestsPerChild 0
>
> => Strange thing is that with these settings a ps aux list a little 1009
> apache processes, so these are no threads but childs ? strange ....
>

This is linux wierdness. They are really threads andnot processes.

> Another thing is that with these settings the performance when load is low
> that response times are higher and requests per seconds is 5 times lower
> then with original settings.

1000 is probably way to large for your test. Under light load, you are still chewing up
lots of RAM and experiencing lots of context switching. The trick is to set
ThreadsPerChild just right.. no greater than you need but large enough to handle the
expected load.

Bill


Re: slow apache 2.0

Posted by Nick De Decker <ni...@i-vision.be>.
Hello,

Settings now for worker mpm :

ThreadLimit   1000
StartServers 1
Maxclients    2000
MinSpareThreads 25
MaxSpareThreads 75
ThreadsPerChild 1000
MaxRequestsPerChild 0

=> Strange thing is that with these settings a ps aux list a little 1009
apache processes, so these are no threads but childs ? strange ....

Another thing is that with these settings the performance when load is low
that response times are higher and requests per seconds is 5 times lower
then with original settings.

Nick


----- Original Message -----
From: "Greg Ames" <gr...@remulak.net>
To: <de...@httpd.apache.org>
Sent: Wednesday, April 10, 2002 5:01 PM
Subject: Re: slow apache 2.0


> Nick De Decker wrote:
> >
> > Hello again,
> >
> > These are my current worker settings (defaults from standard httpd.conf)
> >
> > StartServers         2
> > MaxClients         150
> > MinSpareThreads     25
> > MaxSpareThreads     75
> > ThreadsPerChild     25
> > MaxRequestsPerChild  0
> >
> > => With these settings apache 2.0 kicks ass, but only if concurrent
requests
> > is lower then 26
> > 26 => 1000 per second
> > 27 => 50 per second
> >
>
> Nick,
>
> What happens if you boost ThreadsPerChild way high, like to 1000 or 2000,
and
> change StartServers to 1?  This should let nearly everything be served by
one
> process, and will make it a lot harder to fill up worker's connection
queue.
>
> Greg
>



Re: slow apache 2.0

Posted by Greg Ames <gr...@remulak.net>.
Nick De Decker wrote:
> 
> Hello again,
> 
> These are my current worker settings (defaults from standard httpd.conf)
> 
> StartServers         2
> MaxClients         150
> MinSpareThreads     25
> MaxSpareThreads     75
> ThreadsPerChild     25
> MaxRequestsPerChild  0
> 
> => With these settings apache 2.0 kicks ass, but only if concurrent requests
> is lower then 26
> 26 => 1000 per second
> 27 => 50 per second
>

Nick,

What happens if you boost ThreadsPerChild way high, like to 1000 or 2000, and
change StartServers to 1?  This should let nearly everything be served by one
process, and will make it a lot harder to fill up worker's connection queue.

Greg

Re: slow apache 2.0

Posted by Nick De Decker <ni...@i-vision.be>.
Hello again,

These are my current worker settings (defaults from standard httpd.conf)

StartServers         2
MaxClients         150
MinSpareThreads     25
MaxSpareThreads     75
ThreadsPerChild     25
MaxRequestsPerChild  0

=> With these settings apache 2.0 kicks ass, but only if concurrent requests
is lower then 26
26 => 1000 per second
27 => 50 per second

I still have to install flood but haven't installed cvs for the moment, can
i find tarballs somewhere ?
Ab wont be the best benchmark test, but one must admit that the performance
drop between 26 en 27 concurrent connections is horrible.

System : linux 2.4.18 / duron 1000 / 512 mb sdram / udma100 hd
Apache got compiled with following settings :

./configure \
--enable-layout=Apache \
--enable-so \
--with-mpm=worker \
--enable-ssl \
--with-ssl=/usr/include/openssl \
--enable-mime-magic \
--enable-expires \
--enable-headers \
--enable-usertrack \
--enable-http \
--enable-dav \
--enable-info \
--enable-rewrite \
--enable-speling \
--enable-auth-anon \
--enable-cgi \
--enable-cgid \
--enable-suexec \
--with-suexec-caller=apache \
--with-suexec-docroot=/iVision/users \
--with-suexec-uidmin=1000 \
--with-suexec-gidmin=1000 \
--with-suexec-safepath=/usr/bin:/bin:/iVision/bin:/usr/local/bin


Nick

----- Original Message -----
From: "Aaron Bannert" <aa...@clove.org>
To: <de...@httpd.apache.org>
Sent: Tuesday, April 09, 2002 5:18 PM
Subject: Re: slow apache 2.0


> On Tue, Apr 09, 2002 at 04:47:02PM +0200, Nick De Decker wrote:
> > I'm testing apache 2.0 but i'm having trouble with it.
> > Benchmarks show very slow results when the number of concurrent users
get
> > high.
> > i tested the prefork/worker settings but nothing seems to help.
> > tested with ab :
> > ab -n 10000 -c 1000 http://192.168.1.253/index.html (978 bytes page)
>
> Ab is not very good for testing concurrency. Check out flood for
> somewhat better concurrency (http://httpd.apache.org/test/flood/).
>
> Also, keep in mind that although you'll see better scalability
> with the worker MPM over the "classic" prefork MPM, the biggest
> improvement will be in memory requirements. I've run 300+ threads
> on my solaris 8 box while only consuming around 20MB.
>
> -aaron
>



Re: slow apache 2.0

Posted by Aaron Bannert <aa...@clove.org>.
On Tue, Apr 09, 2002 at 04:47:02PM +0200, Nick De Decker wrote:
> I'm testing apache 2.0 but i'm having trouble with it.
> Benchmarks show very slow results when the number of concurrent users get
> high.
> i tested the prefork/worker settings but nothing seems to help.
> tested with ab :
> ab -n 10000 -c 1000 http://192.168.1.253/index.html (978 bytes page)

Ab is not very good for testing concurrency. Check out flood for
somewhat better concurrency (http://httpd.apache.org/test/flood/).

Also, keep in mind that although you'll see better scalability
with the worker MPM over the "classic" prefork MPM, the biggest
improvement will be in memory requirements. I've run 300+ threads
on my solaris 8 box while only consuming around 20MB.

-aaron