On Sun, 2002-06-23 at 18:58, Rasmus Lerdorf wrote:

> Someone asked me for numbers when I mentioned the other day that Apache
> 2-prefork was really not a viable drop-in replacement for Apache 1.3 when
> it comes to running a PHP-enabled server.
> 
> Apache 1.3 is still significantly faster than Apache2-prefork for both
> static and dynamic content.

Most of the static benchmarks that I've seen posted to dev@httpd
(including my own tests on Solaris and Linux) indicate otherwise.

And for dynamic content, it's tough to make any generalization that
one httpd release is faster than another, because the performance
depends heavily on one's choice of content generation engine.

> Now, part of the blame goes to PHP here for
> the dynamic case. We are compiling PHP in threadsafe mode when building
> the PHP DSO for Apache2-prefork which is not necessary.

You'll definitely see slow performance with PHP and httpd-2.0.
I know of two major factors that contribute to this:

  * mod_php is using malloc and free quite a bit.

  * PHP's nonbuffered output mode produces very small socket writes
    with Apache 2.0.  With 1.3, the httpd's own output buffering
    alleviated the problem.  In 2.0, where the PHP module splits
    long blocks of static text into 400-byte segments and inserts
    a flush bucket after every bucket of data that it sends to the
    next filter, the result is a stream of rather small packets.

> It would be nice
> if there was an apxs flag that would return the MPM type.

+1

> Right now we
> would need to parse the output of httpd -l or -V to figure out which MPM
> is being used. Being able to go non-threadsafe in PHP does speed us up a
> bit. But none of this has anything to do with the fact that Apache 1.3 is
> faster for static files.  It's going to be very hard to convince people to
> switch to Apache2-prefork if we can't get it to go at least as fast as 1.3
> for simple static files.

For what it's worth, I just tried the test case that you posted.  On my
test system, 2.0 is faster when I run ab without -k, and 1.3 is faster
when I run with -k.

--Brian


Reply via email to