At A Small Orange, our shared server fleet currently supports three separate PHP versions- PHP 5.3, 5.4, and 5.5 with 5.3 being the default. For quite a few years, PHP 5.3 has been the accepted standard in the web hosting community enjoying seamless compatibility with a very wide range of web applications. However, with PHP 5.4 now a mature and stable release tree having gained arguably just as wide application support as PHP 5.3 and PHP 5.5 slowly picking up speed, it leaves PHP 5.3 as an antiquated relic of the past (5.3.0 released July of 2009).
Further complicating the PHP version affair is the fact is that PHP 5.3, as of July 2013, is officially End of Life. This means that it will receive no further feature updates and will only receive security updates through July 2014.
What does this mean for you as a web hosting customer here at A Small Orange?
Let’s break it down into a few points that can be construed as our go forward policy (roadmap) through the next year on PHP support:
As anyone will tell you who has ever run a moderately active website using WordPress/CMS engines (or a web server for that matter)- performance is king. The amount of time webmasters and system administrators alike spend on performance tuning is significant to say the least. However, for all those WordPress plugins to improve caching that you may install, the various tools you may install on your VPS such as varnish or the 3rd party services to optimize your configuration and setup, have you ever really thought of the PHP version as part of the performance problem?
The reality is, not all PHP versions are created equal, far from it in fact. There are two notable components to PHP performance, which are execution time and memory usage. In those respects PHP 5.5 vs 5.4 vs 5.3 have significant gaps.
Let’s take a minute to look at some benchmarks we recently performed on one of our shared servers (with no users on it) to gauge exactly where each PHP version sits performance-wise.
PHP Performance: Execution Time
The first test we ran was a bench.php script that ships with the PHP source tree. This script does well to execute a number of components of the PHP stack in a predictable and consistent fashion. We executed the test using PHP versions 5.3.27, 5.4.18 and 5.5.2, each set of executions was run three times and the values averages.
The results speak for themselves, with PHP 5.4 and 5.5 coming in 23% and 28% faster respectively than PHP 5.3. That is effectively a full second shaved off execution time of complex PHP code from 5.3 to 5.5. Impressed yet?
PHP Performance: Execution Time: WordPress
The next test took a WordPress 3.5 installation of one of our more active customers, hosting a sports blog and we processed the index page of the blog through the three PHP versions. All output was piped to /dev/null so that only raw PHP processing time is factored in. The tests, on each PHP version, were executed three times with the values averaged.
We again see similar results as the bench.php execution, where PHP 5.4 and 5.5 significantly improved upon the execution time of PHP 5.3. To put these results into context, with the average website load time being 2.45 seconds, PHP server side processing on 5.3 represents 25% of load time, 5.4 19% and 5.5 17%. In a scaling context, the faster PHP can process each request, the more concurrent users you can get through your site without requiring a hosting package / resource upgrade!
PHP Performance: Memory Usage
Finally, we take a look at the memory usage of PHP across the three versions. The significance of memory usage for PHP cannot be stressed enough, as it is the fastest growing usage component for PHP web sites on shared platforms today. The more complex websites get, the more memory they are chewing for each request served. This is especially a big factor for VPS and dedicated customers alike where memory is a very real cost factor. In this test we used the Phoronix Test Suite to gauge the relative memory usage of each PHP version with a synthetic benchmark replicating a series of common PHP actions. As before, each test on each PHP version was executed three times and the values averaged.
We once again have PHP 5.4 and 5.5 beating out 5.3 by a wide margin; with a difference of some 15MB of RAM or 27% lower memory usage. That is effectively, for every 4 users you previously had visit your site, you can now concurrently handle an extra user without breaking a sweat. To illustrate that a little better, if you had a website with an average of 20 concurrent users a minute, each with 100 hits per visit, you could scale on PHP 5.4 to handle an extra 5 users per minute or an additional 30,000 hits an hour.
The take away here is pretty clear. PHP 5.3 is old, slow, and no longer maintained while PHP 5.4 and 5.5 are lean and modern versions that offer very tangible performance improvements. We look forward to seeing our entire shared hosting fleet updated to PHP 5.4 in the coming months and helping our customers realize improved web site load times as a result.
We will be posting further updates shortly before the 5.4 rollout takes place to let customers know more details on the exact rollout plans and schedule along with some helpful support references to make the transition easier should you decide to move off 5.3 immediately.
Thanks and check back soon!