PHP Roadmap & Performance

PHP


PHP: Today and Tomorrow

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.


PHP Performance: The real deal

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.

PHP Performance: Execution Time

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.

PHP Execution Time: WordPress

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.

PHP Memory Usage

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.

PHP Wrap-up

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!

7 Responses to PHP Roadmap & Performance

  1. djbaxter says:
    August 22, 2013 at 10:05 am.

    Warning for vBulletin users:

    We are still waiting for an update to vBulletin 4.2.1 to make it compatible with 5.4 or 5.5. At present, upgrading PHP the 5.3.x will result in errors.

    The latest version of vBulletin 3.8.x is PHP 5.4 compatible; I’m not sure about PHP 5.5.

    vBulletin 5.x is currently not even close to being ready for prime time. Yes, it is compatible with PHP 5.4 and possibly 5.5, but the software is slow, buggy, and incomplete. How Internet Brands thought this was worthy of a Gold release defies all rationality.

    • Ryan MacDonald says:
      August 22, 2013 at 10:44 am.

      Thank you for your feedback.

      As noted in the policy and likewise as currently is the case on servers, users will be able to set PHP versions themselves with a simple htaccess entry for 5.3 and 5.5 while 5.4 is the default. Similarly, for existing customers, they will have the PHP 5.3 htaccess entry explicitly added to ensure the behavior of your website does not change overnight. Then, at your discretion, you can remove the 5.3 htaccess to test / move permanently onto 5.4 as default.

  2. TheForumGuy says:
    August 22, 2013 at 10:36 am.

    Thank you ASO. This is a great writeup and policy

  3. CruelCoulter says:
    August 23, 2013 at 11:19 am.

    Thanks for the update. Is there a summary of changes from 5.3 to 5.4 and 5.4 to 5.5 so we can check our code before upgrading?

  4. Jose Cervantes says:
    September 18, 2013 at 2:54 am.

    Very useful and informative write up about the different PHP versions available. Thank you.

  5. Kevin Trye says:
    October 10, 2013 at 8:02 pm.

    Great summary. Passed this post onto many friends.

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>