Shawn McCabe
Author Shawn McCabe
CTO
Posted in Development , Drupal
July 7, 2016
read
Back to blog

Increase your Drupal 7 site speed with PHP 7

PHP has spent many years in the 5.x era, moving through point releases and incremental functionality changes. There was an attempt at a large unicode rewrite for PHP 6 that never got too far off the ground and we’ve just kept trucking along on PHP 5.

We’ve now skipped right past PHP 6 and on to PHP 7, which has focused almost exclusively on performance, with some very dramatic improvements. Many benchmarks have been touting a 2x speed increase, and some initial benchmarks on Drupal 8 and other PHP platforms have shown that to be true. What about Drupal 7 though? For lots of people a Drupal 8 upgrade is a long way off. PHP 7 is largely backwards compatible with PHP 5, so making Drupal 7 work on it is not out of the question. Just recently Drupal 7 achieved 100% passing test coverage on PHP 7 and I figured we should run it through some benchmarks to test performance.

Not technical? Click here to learn how faster websites make more money.

 php-5-vs-7-loadtime.png

As you can see in the chart above, the improvements are even greater than expected, with average response times 2.5x quicker on a standard Drupal install and 3x quicker on a standard Drupal Commerce Kickstart install.

For the above benchmarks, I ran the following setup:

  • Stock Ubuntu 14.04 nginx setup on an AWS t2.small instance
  • Both setups are identical except for the PHP version.
  • I used Apache Bench for the tests, running 1000 requests at 10 concurrency

Command:

ab -n 1000 -c 10 http://mydomain.com/

I ran the tests multiple times to ensure consistent results and also ran them with different concurrency settings, which produced different times but the same ratio between PHP5 and PHP7.

Some cursory results also show it using about half the amount of memory, but I’d like to profile that a bit more accurately before I feel totally confident in those results.

Drupal 7 and Drupal Commerce 1.x are quite new to running on PHP7, so use them with caution, but with such drastic speed improvements, it seems very easily worth the risk.

Are interested in upgrading your site to PHP 7?

If you are interested in upgrading your Drupal 7 and/or Drupal Commerce 1.x site to PHP 7, contact Acro Media for assistance or download our PHP 7 Upgrade Information Sheet.

Download Our PHP 7 Upgrade Sheet

The Heartbleed Bug - What you need to know!

You may have heard of the "Heartbleed" security issue, which is affecting many sites across the internet, including enormous entities such as the ...
Keep Reading »

Beware of P.O.O.D.L.E, SSLv3 Vulnerability & Security Update

So the hip new thing is to give big security vulnerabilities silly nicknames, hence the "Padding Oracle On Downgraded Legacy Encryption" -> POODLE ...
Keep Reading »

How Attending DrupalCon Events Changed our Business

New Orleans. NOLA. The pilgrimage to DrupalCon 2016. Six Canadians making the journey from a well established Drupal Commerce development agency…. ...
Keep Reading »

Fields marked with * are required.

×
×