Benchmarking Drupal 7 on PHP 7-dev

Benchmarking Drupal 7 on PHP 7-dev

Piece of Cake

There are big expectations surrounding PHP7.

PHP has seen the threat and needs to keep up with competitors such as HHVM or the recently open source and cross platform compatible .Net Framework. Even a while ago (2011) the .Net implementation of PHP (Phalanger) already was light years superior and much better performant than Zend Engine, and was proposed as a replacement of the Zend Engine (read the full story here).

So we decided to download the latest available dev version of PHP7 and spend 15 minutes to do a quick benchmark of a freshly installed D7 home page.

This is a 100% default D7 setup on Windows (IIS 8.5) against a local MySQL database and no modifications whatsoever with Zend Opcache turned on.

Benchmarked using Apache Bench with c=20 and n=1000

With PHP 7.0.0-dev (Build date: Mar 14 2015 22:22:57):  490 requests per second

With PHP 5.6.6: 310 requests per second.

That is nearly 58% more throughput. Quite impressive.  Of course this is a simple and superficial benchmark, but possible indicator of what is about to come.

And what if we enable page caching?

With PHP 7.0.0-dev (Build date: Mar 14 2015 22:22:57):  1800 requests per second

With PHP 5.6.61550 requests per second.

That's an extra 16%.

One first impression is that PHP7 is going to benefit more non-static (or none "presentation card") websites, AKA Web Applications.

I can't wait to see the real difference once the SQL Server PDO driver and Wincache are available for PHP7, and God willing native prefetching is finally fixed in the SQL Server PDO.


Thanks for sharing this valuable information. I still want to ask if Drupal 7 (and major contributed modules) are compatible with PHP-7 ? What are your experiences regarding this? Thanks.

There is a big chance that we will never see D7 running on PHP7 because D7 is "abandoned". Just take a look at this issue. Basically no one cares about D7 anymore because all the small sites have fled to Wordpress and the big ones cannot keep on working with the shortcomings of D7 - so they are focusing only on D8.

I don't believe D7 is abandoned. Drupal 8 has a long way to go before it will be ready for many sites, as there is a need for a lot of modules to be upgraded for Drupal 8. I just got PHP7 and D7 is running just fine on it, only one small hiccup with the editable_fields module and we're set. I was hopeful that I would see a dramatic increase in performance as I had heard was possible with PHP7. I do see a slight performance increase, and I confirmed that I am running it with opcache enabled. But I'm a little disappointed, it seems that these results for Drupal 8 are accurate. So, now I will work on installing HHVM to get that boost I believe is available. My results with Drupal 7 on PHP7 look like what I see here kinsta blog post : the-definitive-php-7-final-version-hhvm-benchmark for Drupal 8.0.1, so I'm hopeful that HHMV will perform as shown here with D7.

Add new comment

By: david_garcia Sunday, March 15, 2015 - 09:58