PHP4 vs PHP5 Performance?



Recently, I've been doing a lot of benchmarking with Apache to compare
different OSes and platforms. I did a stock install of Ubuntu 7.04
Server w/ Apache2 and PHP5. To do the test, I used ab to fetch the
following document:

<html>
<head>
<title>PHP Web Server Test</title>
</head>
<body>
<?php phpinfo(); ?>
</body>
</html>

I ran ab in a loop 12 times with 10,000 connections and a concurrency
of 10. Then I threw out the highest result and the lowest result and
averaged the remaining values. Both PHP4 (v 4.4.7) and PHP5 (v
5.2.3) were built as Apache modules, and I simply changed Apache's
config file to swap modules.

The results were somewhat surprising to me: on average, PHP4
significantly outperformed PHP5. Over our LAN PHP5 handled roughly
1,200 requests / sec while PHP4 handled over 1,800 requests / sec.
Since everything I have heard/read is that PHP5 is much faster than
PHP4, I expected the opposite to be true, but the numbers are what
they are. Also PHP on Apache1 was much faster than on Apache2.

The only difference I can figure is that PHP5 was the packaged version
that comes with Ubuntu and I had to compile PHP4 from source since
there is no package for it in Feisty. But I wouldn't expect a 50%
increase as a result of that. Any thoughts on this?
.



Relevant Pages

  • Re: [PHP] PHP4 to PHP5 issue
    ... run php4 on it and use the apache ProxyPass directive to make the php4/apache ... From what I've heard of other hosting companies doing, you can use the same Apache installation and run PHP4 and PHP5 concurrently. ... DirectoryIndex index.php index.html ...
    (php.general)
  • Re: [PHP] PHP4 vs PHP5 Performance?
    ... PHP5 being faster than PHP4 is greatly dependent on what features you ... I've consistently found PHP4 to be faster for my purposes also. ... I've been doing a lot of benchmarking with Apache to compare ... Also PHP on Apache1 was much faster than on Apache2. ...
    (php.general)
  • Re: [PHP] PHP4 to PHP5 issue
    ... Apache installation and run PHP4 and PHP5 concurrently. ... AddType application/x-httpd-php .php ...
    (php.general)
  • Re: PHP4 and PHP5
    ... Is it posible to run apache with PHP4 and PHP5 on different virtual ... for Multilingual Web Sites, Web Designs) ...
    (php.general)
  • Re: prob. w. wordpress + php5
    ... But WordPress, in particular the Textile 2cb plugin, has a bug in it using php5 that makes enumerated lists come out wrong. ... I have the version of sid with apache + php4 on a mirror. ...
    (Debian-User)