It’s been in the works for quite some time and after a long wait PHP 7 was released on December 3, 2015. We tested the most popular PHP based frameworks to see how they perform with PHP 7!
It’s a great day for all of us who use PHP every day and that doesn’t just include developers (and web hosting companies) but end users as well. It will speed up the most popular web development language in the coming weeks and months which means faster websites and web services for everyone!
We’re addicted to optimizing the load times of websites and we’ve released numerous guides on the topic previously, take a look at A Beginner’s Guide to Website Speed Optimization, Best Free Website Performance Testing Tools, and more.
To see how much of an improvement we can expect from this new PHP interpreter we put the public release version of PHP 7.0 to test and compared a couple of popular software suites’ performance using PHP 5.6.16, PHP 7.0 and HHVM 3.10.1 on a bare metal server (so virtualization doesn’t interfere with the results). Tested software includes WordPress 4.3.1, Drupal 8, Magento 2.0 CE, OctoberCMS build 309, PyroCMS v3 beta2, and Flarum v0.1.0-beta.4.
Long story short, HHVM wins hands down. We won’t be abandoning our HHVM-first policy here at Kinsta. As we focus on high traffic websites it is of utmost importance for us to only work with the very best technologies available and that’s clearly not PHP 7 as of now. Nevertheless we’ll be offering PHP 7 as a fallback solution and will phase out PHP 5.6 completely in the coming weeks. If you want to host your site(s) on our managed servers that take advantage of the best performing server software, get in touch!
The bare metal machine we used for the following benchmarks has an Intel Xeon E5-2630v3 processor (8 CPU cores and 16 threads), 64 GB RAM and 2 x 4 TB SAS 7200 rpm HGST disks in RAID 0.
We used MariaDB 10.1.9 for the MySQL server and Nginx 1.9.7 for the web server.
WordPress 4.3.1
We used dummy content from wptest.io and benchmarked the home page for a minute with 15 concurrent users. This was the only test where we could use HHVM’s Repo Authoritative mode without having to make time consuming modifications to the software in question. It adds some extra speed but it may not be something everyone can take advantage of because of the extra deployment steps required to make it work.
WordPress HHVM RA benchmark result: 375.48 trans/sec
WordPress HHVM benchmark result: 357.69 trans/sec
WordPress PHP 7.0 benchmark result: 306.24 trans/sec
WordPress PHP 5.6.16 benchmark result: 106.45 trans/sec
Drupal 8.0.1
Standard installation with the devel module’s 50 posts sample data. Benchmarked the home page for a minute with 15 concurrent users. This was the most interesting result of all, we deleted the Drupal installation completely after getting these results and installed again, set it up same as before and re-did all the test. Almost exactly the same results!
Drupal 8 HHVM benchmark result: 1739.28 trans/sec
Drupal 8 PHP 7.0 benchmark result: 917.10 trans/sec
Drupal 8 PHP 5.6.16 benchmark result: 794.20 trans/sec
Magento 2.0 Community Edition
Standard install with the official sample data package. Magento’s internal caches were turned on otherwise it’s a miserable 5 transactions/second… Benchmarked the home page for a minute with 15 concurrent users.
Magento HHVM benchmark result: 192.19 trans/sec
Magento PHP 7.0 benchmark result: 183.87 trans/sec
Magento PHP 5.6.16 benchmark result: 113.34 trans/sec
OctoberCMS
A Laravel based CMS system that’s popular in itself plus gave us the opportunity to test the underlying Laravel framework as well! We chose the Vanilla theme during installation which has a user system, a blog and a forum. Benchmarked the home page for a minute with 15 concurrent users.
OctoberCMS HHVM benchmark result: 583.07 trans/sec
OctoberCMS PHP 7.0 benchmark result: 407.89 trans/sec
OctoberCMS PHP 5.6.16 benchmark result: 248.19 trans/sec
PyroCMS v3 beta2
Another Laravel based content management system. We used the default setup and added a blog post and tested that “single page” for a minute with 15 concurrent users.
PyroCMS HHVM benchmark result: 177.39 trans/sec
PyroCMS PHP 7.0 benchmark result: 145.95 trans/sec
PyroCMS PHP 5.6.16 benchmark result: 75.17 trans/sec
Flarum v0.1.0-beta.4
Delightfully simple forum software. Flarum is the combined successor of esoTalk and FluxBB. It uses a mix of Laravel’s, the Zend Frameworks and Symfony components (among others of course) and it’s an up and coming software suite in the PHP world so we thought it’d be interesting to include it.
Oops: for now it looks like we’ll have to keep Flarum here as a placeholder only as it doesn’t run either with HHVM or PHP 7. On HHVM we got “Fatal error: Return inside a finally block is not supported in vendor/flarum/core/src/Foundation/Application.php on line 120” and on PHP 7 it was “Notice: Undefined property: stdClass::$data in vendor/flarum/core/src/Http/Controller/ClientView.php on line 326” and a 90% broken screen completed with JavaScript errors… We’ll talk to the devs about these issues and update this post once it’s stable on these new platforms!
Summary
That’s all, folks! The results are pretty self-explanatory. If you want us to include another framework or app, let us know! Comments are welcome.
A quick note: if you use Debian/Ubuntu chances are you’re using Ondřej Surý‘s PHP packages. He maintains his repositories in his free time and accepts donations. If you feel like he’s helped you in the past, buy him a beer! His bitcoin address is 15WRQCrVHWUdcn3sbT7PF6u2FJGfbb8GW5
Featured image via Digital Ocean.