At A Small Orange, our shared 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:
- We intend to fully support and offer PHP 5.3 to customers through July 2014 at which point we will discontinue it for security reasons. That means customers have at their disposal 3 PHP versions for at very least the next year, PHP 5.3.x, PHP 5.4.x and PHP 5.5.x.
- We intend to roll out PHP 5.4 as the default PHP handler in the very near future (Sept – Oct) as it is quickly becoming the new standard expected by web applications and customers alike. We also feel very strongly that it stands to improve the security and performance for our servers and customer websites alike.
- When the default PHP handler is changed from 5.3 to 5.4, new customers will be placed on PHP 5.4 and existing customers will automatically have a special htaccess entry added into their account which ensures they continue serving content on PHP 5.3. At no time will customers, for the next year, be forced to a higher PHP version. If you decide you want PHP 5.4, you would just remove the htaccess entry or request our support team do so for you. Don’t like the results? Not a problem, you can quickly be set back onto PHP 5.3 just as easily. We will detail this process further shortly before / during the PHP 5.4 rollout.
- When we move our shared fleet onto PHP 5.4 as default, we will also set our Cloud VPS cPanel and Dedicated Server cPanel templates to default onto the same versions (For new deployments only!). Just like our shared fleet though, customers can at any time, by themselves or requesting it of our support team, switch to any of our supported PHP versions.
- With an upgrade to PHP 5.4, we will move our default MySQL stack from MySQL 5.1 to MySQL 5.5 for new shared servers and new Cloud & Dedicated servers. The upgrade of existing shared servers to MySQL 5.5 will take place as a separate upgrade shortly after the PHP 5.4 rollouts in the coming months.
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 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!