SilverStripe and HHVM in Production

152 views
Skip to first unread message

Stefan

unread,
Oct 10, 2014, 4:14:08 AM10/10/14
to silverst...@googlegroups.com
Hi,

I wanted to gather some impressions of the current state and ask if anybody uses SilverStripe on HHVM successfully in production?
Because we've currently tested HHVM on test servers based on production sites and are pretty impressed. Not only about the performance, but also how easy it is to install!

Our starting point:
We are using a pretty optimized configuration of nginx and php-fpm on Amazon.
For the frontend we developed a pretty dynamic caching based on redis, which further allows us to use nginx' microcache. But we are still trying to get a better performance, especially for the CMS where we cannot use our dynamic caching.

Maybe a year ago, we gave HHVM a try but stopped quickly, as important extensions like mysqli and APIs for XML where not supported. Also the installation was not so easy, also in combination with our automatic deployment.

HHVM today:
In the last days we gave HHVM a new chance and we are impressed how solid it seems.

Installation? 5 Minutes!
There are official packages for the big linux distributions.
If you are using nginx with php-fpm you may only have to change one line (since both, php-fpm and hhvm, talk fastcgi): the line where you are setting the unix socket, you just change it from php-fpm's to hhvm's path.

Does it work? Yes!*
*But only on a first quick overview! We tested it with the SilverStripe 3.1.6 without modifications and we have not found any fatal error yet, but of course we only tested the frontend and the CMS by hand in the browser.

There is a fork of SilverStripe which fixed some bugs, but this is already months ago. The github project is extremely active, so I think since then there have been a lot of changes and fixes.
The fork is discussed here:
https://groups.google.com/d/topic/silverstripe-dev/l1cjYU7q4r4/discussion

SilverStripe is listed on the frameworks page of HHVM: http://hhvm.com/frameworks/
Currently the status is at 97.22%

Performance? Holy s...!
We've tested a small project with a small code base and a plain SilverStripe 3.1.6 and one big project with a heavy code base (also 3.1.6, dynamic caching with redis and tagging, lot of extensions).
After a short warmup the hole CMS seems a lot faster. The CMS requests are up to 3 times faster, but at least 50%!

Are there plans to officially support HHVM?
...or at least plans to do some fixes form time to time to keep the tests (http://hhvm.com/frameworks/) at 100%?

What are your experiences with HHVM?
It would be nice to see some response!

Thanks!

Stefan

Simon J Welsh

unread,
Oct 10, 2014, 5:11:56 AM10/10/14
to silverst...@googlegroups.com
Hey,

I have been rather involved with the HHVM project, including the SilverStripe support. I am using it for four SilverStripe sites in production and my local dev environment. The two blockers that existed in the HHVM 2 branch (Reflection incompatibilities needed for part of the manifest to work and the lack of recursive magic methods) have long been fixed.

No changes are required to SilverStripe. The test failures are due to a lack of tidy (the tests should be skipped in this case) and differences in the output from DOMDocument when handling poorly formed HTML (which only matters if you have HTMLText fields not going through tinyMCE).
> --
> You received this message because you are subscribed to the Google Groups "SilverStripe Core Development" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to silverstripe-d...@googlegroups.com.
> To post to this group, send email to silverst...@googlegroups.com.
> Visit this group at http://groups.google.com/group/silverstripe-dev.
> For more options, visit https://groups.google.com/d/optout.

---
Simon Welsh
Admin of http://simon.geek.nz/

Mark Guinn

unread,
Oct 10, 2014, 5:55:31 AM10/10/14
to silverst...@googlegroups.com
Stefan,

We’ve not used it in production before but I’ve got several of our larger sites working under vagrant. We’re going to launch one next month are strongly considering deploying to hhvm. My experience was pretty similar. I encountered a few issues around the way $_SERVER is populated (particularly $_SERVER[‘HTTPS’]) but other than that it was just tweaking our app (things like having php_value directives in .htaccess). Speedwise I found it difficult to gauge how much difference there is between php5.6 (which is quite a bit faster than any previous) and hhvm. I read some statistics recently that said the two were similar at low loads but hhvm shines clearly at higher load.

We’ll probably start setting up the production environment for this new site in the next week or two. I’ll let you know if we hit any other walls.

Thanks for sharing your experience too!

Mark


Stefan

unread,
Oct 10, 2014, 6:07:36 AM10/10/14
to silverst...@googlegroups.com
Hey Simon,

thanks for your quick response and of course for your effort in improving SilverStripe on HHVM!
I'm very happy to hear that!

Stefan

Stefan

unread,
Oct 10, 2014, 6:25:06 AM10/10/14
to silverst...@googlegroups.com
Hi Mark,

the tested sites were running php5.5, so unfortunately I cannot tell anything about the difference between 5.6 and hhvm. But I'm happy to see this kind of performance run between hhvm and php.net (looking forward to phpng)!

One thing we have not tested is the integration of new relic, which should work with an extension on github. But that's of course not a SilverStripe issue ;). Maybe I can tell more about it in the next weeks.

Thanks for your response!

Stefan

Conrad Dobbs

unread,
Oct 14, 2014, 10:05:36 PM10/14/14
to silverst...@googlegroups.com
I did some testing with it on the weekend with a 3.1 site. Everything looked to work fine, but when I used a load tester it would always crash after around 1000 requests. Nothing in the logs to indicate what went wrong.

Nicolaas Thiemen Francken - Sunny Side Up

unread,
Oct 14, 2014, 10:27:49 PM10/14/14
to silverstripe-dev
does anyone have a recipe for running Silverstripe with HHVM?

--
You received this message because you are subscribed to the Google Groups "SilverStripe Core Development" group.
To unsubscribe from this group and stop receiving emails from it, send an email to silverstripe-d...@googlegroups.com.
To post to this group, send email to silverst...@googlegroups.com.
Visit this group at http://groups.google.com/group/silverstripe-dev.
For more options, visit https://groups.google.com/d/optout.



--
Nicolaas Thiemen Francken
  www.sunnysideup.co.nz
  phone: +64221697577

Sean Harvey

unread,
Oct 14, 2014, 10:47:17 PM10/14/14
to silverst...@googlegroups.com
Hi Nicolaas,

I opened a pull request documenting setting up nginx with HHVM here: https://github.com/silverstripe/silverstripe-framework/pull/3539
Not merged yet, but will be good to get some feedback :)

Cheers,
Sean

Will Morgan

unread,
Oct 15, 2014, 11:22:29 AM10/15/14
to silverst...@googlegroups.com
That sort of conclusion doesn't hold much value unless you share with us the specifics. Crucially, did you test 3.1 on vanilla PHP? What were the machine specs? _How_ did you conduct the load tests?

FWIW, that sounds like it has more to do with the hardware than HHVM.

Conrad Dobbs

unread,
Oct 20, 2014, 4:48:26 PM10/20/14
to silverst...@googlegroups.com
Sorry, not the most useful reply, was a quick play on the weekend for a bit of "fun" out of curiosity. The site was built on 3.1 and runs fine on apache/mod_php. I setup HHVM using apache fastcgi. Browsing the site worked fine, but when I used a load tester it would crash and give errors around the 1000 request point. Was just interested in a quick comparison of response times and to see how stable it was. Testing was done with both apache jmeter and apache bench.

Nicolaas Thiemen Francken - Sunny Side Up

unread,
Oct 20, 2014, 5:31:20 PM10/20/14
to silverstripe-dev
Thank you Sean.

Reply all
Reply to author
Forward
0 new messages