emjayess's picture

The HipHop VM project announced fastcgi support, and published a couple benchmarks, as compared with php-fpm behind nginx.

I'm just curious if anyone is using HHVM and Nginx for Drupal, or has any thoughts on doing so?


Will be testing soonish

mikeytown2's picture

We got the previous version of HHVM to bootup Drupal, but it failed with the geoPHP library. We'll hopefully get the new version HHVM up and running by the end of the year.

1st bug

mikeytown2's picture

We hit this bug. Drupal isn't really useable till this gets fixed https://github.com/facebook/hhvm/issues/1108

100% test coverage (but what's it mean?)

emjayess's picture

The HHVM crew posted a follow on post espousing a "perf & parity" sprint, which claims to have achieved 100% passage of Drupal's test suite.

However, I'm no where near familiar enough with Drupal's test suite to know if that hhvm bug 1108 (drupal stream wrappers) is accounted for, or can be.

And, of course, no Drupal build is 'just core'.

matt j. sorenson, g.d.o., d.o.

HHVM will need a core patch most likely

mikeytown2's picture

Looks like core will need to be patched. image_gd_check_settings() calls get_extension_funcs() and that is not going to be supported in HH according to the error log.

Created issue here https://drupal.org/node/2161955

I was able to get the Drupal7

gokulnk's picture

I was able to get the Drupal7 instance up and running on HHVM(Full stack and not fastCGI) but however had no luck with the clean urls.

Were you guys able to enable the clean urls?

Gokul N K

I was able to get drupal 7

Beanjammin's picture

I was able to get drupal 7 working with clean URLs using HHVM (fastcgi) with Apache 2.4.

I found the D7 installation (7.27 + drupal-2161955-18-gd-remove-get_extension_func-D7.patch) failed at the "Install Profile" stage, when the modules are being set up, and never got to the "Configure Site" stage. I was able to get past this by using drush to login as uid 1 and finishing up the configuration. After this the site appeared to work properly, however I didn't have any contrib modules installed.

I hope to do some benchmarking with it and will post my results.


mikeytown2's picture

Be sure to test file and image operations. Good luck :)


jgrubb's picture

I got one of my sites to come up yesterday after reading the post about fastcgi support, but the HHVM log was full of notices and finally bombed out on something that I can't remember that was in the apachesolr module. I'm extremely excited about HHVM, but I'd stick with FPM unless you just want to play around.


This will be quickly dated but...

jgrubb's picture

A loose write up of my initial experience with HHVM and Drupal. It's not ready for production with my setup yet, but overall it was a very encouraging experiment.



Thanks for the report. It

Garrett Albright's picture

Thanks for the report. It actually sounds pretty promising that things have gotten this far along now, given the enormity of the task (write a brand new high-performance interpreter for a massive, widely-used programming language old enough to vote and have it work with a relatively complex CMS with a huge contrib code space).

They didn't specify it in their blog post, but it looks likely that when the HHVM group was talking about 100% test passage with Drupal, they were talking about D7. Here's hoping they can do the same with D8 before launch, as D8 has Views in core and other functionality making it easier to build a decent site without contrib modules.

Drupal 8

Berdir's picture

One drupal 8 issue that I discovered is https://github.com/facebook/hhvm/issues/1413.

I have no idea what they mean with unit test coverage as Drupal 7 doesn't really have unit tests at all. and I'm quite sure they weren't running all web tests.

I was able to run the PHPUnit tests with "cd core; hhvm vendor/bin/phpunit", there are two test fails in there that I haven't looked into/reported yet, should be worth doing.

I haven't been able to run Simpletests through the UI yet, run-tests.sh results in some notices and then a PDO exception.

I'd suggest we open a meta issue to track HHVM and drupal issues and collect information what works and how to test it. Would be awesome if we can make this work and if we can make it run the tests then it should be possible to make it work well enough for real usage.

Testing nuances

emjayess's picture

I presumed they were alluding to running D7's core test suite, e.g. https://qa.drupal.org/7.x-status (?), but again, I've not become closely acquainted with all of Drupal's tests.

I am aware that some of the web tests will predictably fail in an nginx environment (at least, nginx with perusio's drupal config) as several of the tests expect to be able to directly access php scripts (I've noted this previously in the group as well).

matt j. sorenson, g.d.o., d.o.


Just tested HHVM on one of my

ttkaminski's picture

Just tested HHVM on one of my sites and I found the the performance was the same as PHP-FPM. Here's some info on my tests/setup:

Drupal 7
157 Enabled Modules
29084 Nodes
Memcache Enabled

Web Server:
nginx version: nginx/1.4.5

PHP 5.4.25 (fpm-fcgi) (built: Mar 6 2014 01:22:45)
Copyright (c) 1997-2014 The PHP Group
Zend Engine v2.4.0, Copyright (c) 1998-2014 Zend Technologies
with XCache v3.1.0, Copyright (c) 2005-2013, by mOo
with XCache Cacher v3.1.0, Copyright (c) 2005-2013, by mOo

HipHop VM 3.0.0-dev+2014.03.21 (rel)
Configured as FastCGI server

I assume that our site is bottle-necked by the speed/latency of mysql and memcache. Based on my results, I don't see any benefit of using HHVM on our site.

Can anyone else confirm/deny these results on a drupal 7 site with lots of enable modules and nodes?

157 modules???

likewhoa's picture

srsly, i don't think much will save you with so many modules enabled. You should look at bringing that module count down before anything else.

What kind of benchmarks did you actually run to determent that HHVM was not ideal for you anyways?

bending technology to fit businesses.

Performance testing

ttkaminski's picture

Performance due to # of modules was more a problem with Drupal 6. In Drupal 7, the caches do a good job minimizing the performance impact.

For performance testing, I used "ab" test tool with concurrency of 10, with a total of 100 requests. Tested both cached and uncached pages. In both cases HHVM and PHP-FPM performed about the same.


mikeytown2's picture

This is correct. In D6 the # of modules had a much bigger impact on the sites speed.

I also had similar results with HHVM. We had a lot of errors output from HHVM about file issues last time I tried using it. I think we need to open a new bug on HHVM as this test failed and it never got fixed in the issue https://github.com/facebook/hhvm/issues/1108#issuecomment-32072064

I'd bet that HHVM slows down when it throws errors. Get rid of the errors and the true speed improvements should be there.

Verbose logging

ttkaminski's picture

For me, the error log doesn't show any warnings, but when I turn on "Verbose" log level, I get:

receiving index.php
f_is_file/806: No such file or directory
f_is_file/806: No such file or directory
Light-weight fork not available; use the heavy one instead.
f_is_dir/824: No such file or directory
f_is_dir/824: No such file or directory
f_is_dir/824: No such file or directory
f_is_file/806: No such file or directory
f_is_file/806: No such file or directory
f_is_file/806: No such file or directory
f_is_file/806: No such file or directory

Not sure if this is affecting performance? I only tested a couple of pages on our site. I'm sure there must be some pages that throw more errors/warnings.

Have you tried the latest version of HHVM?

Side note