HHVM Tuning

  • Disabling The Typechecker:

HHVM automatically runs the typechecker – this is useful in development, but assuming you have it running in your development workflow and in your CI system, there is not much additional benefit to running it in production, and the increased memory usage can be costly in production. To disable it, add the following to /etc/hhvm/server.ini:

Reference:
https://hub.docker.com/r/hhvm/hhvm-proxygen/

  • Switch to UNIX socket inside of port for fastcgi mode:

HHVM is considered for environments under heavy load so the first configuration change you can do is to make HHVM listen to a socket instead of a TCP port. Thus, the communication between Nginx and HHVM will require less CPU and memory.

Add this to: /etc/hhvm/server.ini

I also common out the port line to increase a bit of security.

Then change the Nginx config to hhvm as well:
/etc/nginx/hhvm.conf

  • Tweaking Memory:

By default the memory_limit is equal to 17179869184 bytes, which is 16 GB.
Such a high memory resource limit will certainly kill a server with a few GB of RAM, making it unresponsive.
I decrease this value to 500 MB for a 1 GB memory Server:

Add this to: /etc/hhvm/php.ini

Restart to apply the changes:

Reference:
https://www.digitalocean.com/community/tutorials/how-to-install-hhvm-with-nginx-on-ubuntu-14-04

  • A much more pushed example for a bigger server:

Reference:
https://github.com/facebook/hhvm/issues/7754

HHVM 3.18.0 crash on Ubuntu 16.04 with Nginx

Just try to bring up an new HHVM host on Ubuntu 16.04 with Nginx.

But HHVM keep crush error in /var/log/hhvm/error.log
It created error log in /tmp

Here is a example:

Run ls -alt /var/run/hhvm
Since upgrading to 3.18, hhvm is unable to open hhvm.hhbc as it is created as root instead of www-data.

For now the workaround is to add the following to your configuration: /etc/hhvm/server.ini

Restart the HHVM service.

And it works.

Hope HHVM team can fix it in the next release.

Reference: https://github.com/facebook/hhvm/issues/7674

Nginx and HHVM always return a 404

This because the /etc/nginx/hhvm.conf did not load before the root in vhost.

This is just a quick notice for myself, I will add more example later:

3 fix solutions:

1.move root out of /

OR:

2.move hhvm into /

3.add /var/www replace $doc_root

My /etc/nginx/hhvm.conf file:

Reference:

    http://stackoverflow.com/questions/28308099/nginx-and-hhvm-always-return-a-404

HHVM 3.14 update missing error while loading shared libraries: libdouble-conversion.so.1 and liblz4.so.1

One of my Ubuntu 14.04 LTS server running HHVM for a while.
Recently the 3.14 update just came, after upgrade the HHVM won’t start:

Than I installed the libdouble-conversion library:

But still no luck:

I have to install liblz4 to fix it:

I noticed my Debian 8 Jessie server doesn’t have this issue, only the Ubuntu 14.04 LTS.

Just a heads up for every one test your code and server before you upgrade the production system.

I like (not love anymore, since version 3.10) HHVM, but it got some quality issues since Version 3.10.
Hope it just a temporary thing.

I will keep support HHVM but not suggest it in production system.

Have a nice weekend!

HHVM Segfault since latest update (3.13.0) switch to LTS 3.12.1

Today is March 31, 2016.
Just upgrade the HHVM to latest update 3.13.0.

Then my blog start to crash, restart the HHVM service several times, No help.
Check the log and debug into No help.

HHVM’s Github support also reporting similar issue:
https://github.com/facebook/hhvm/issues/6950

So I switch to the latest LTS which is 3.12.1 at this moment.
https://docs.hhvm.com/hhvm/installation/linux

First I backup my own HHVM config file:

Then clean up the 3.13.0 package:

Put new apt config file: /etc/apt/sources.list.d/hhvm.list

Install the latest LTS HHVM:

Recover my backup config file:

Start the service:

And I am back.

I love hhvm, but you better stay on LTS for production level service or system.

Have a nice day!

Update April 4th, 2016:

My HHVM 3.12.1 just crash, but a restart service make it stable for next few days.

It seems there are 2 tweaks you can try:

1.Maybe usefull: When the daemon is started via systemctl it dies after some requests. It will runs if run by:

2.Changing /etc/hhvm/php.ini using hhvm.log.level = Error

Reference: https://github.com/facebook/hhvm/issues/6950

I also add these line in my /etc/hhvm/php.ini

Magento on HHVM 3.3 Nginx 1.6 on Ubuntu 14.04 trusty

No more Varnish! Love HHVM!

1.First this VPS box running Ubuntu 14.04 trusty 64 bit with 2 GB Memory and 2 Core CPU.
Please follow HHVM, Nginx and MariaDB ‘s offical installation guide to install:



After installation I have these files under /etc/apt/sources.list.d/:
nginx.list

mariadb.list

hhvm.list

At this moment I have the version:

2.Share my Nginx config file:
/etc/nginx/nginx.conf

/etc/nginx/hhvm.conf

/etc/nginx/fastcgi_params

/etc/nginx/sites-enabled/magento

3.My HHVM config file:

/etc/hhvm/server.ini

/etc/hhvm/php.ini

Thank you for the kind sharing from:

HHVM, MariaDB and Nginx Make WordPress Fly – Intro

Install HHVM, Nginx on Ubuntu 14.04 – Make WordPress Fly


http://wiki.nginx.org/Install#Official_Debian.2FUbuntu_packages

HHVM Nginx WordPress a working tutorial


http://stackoverflow.com/questions/23872439/nginx-rewrite-with-laravel-and-hhvm

Fix HHVM 3.3 Bad Gateway error Debian Ubuntu

Found HHVM upgrade to 3.3 on Ubuntu Server 14.04 LTS:

The web server shows: Bad Gateway.

Try restart HHVM:

Install libgmp10 package, restart HHVM solve the problem: