HHVM as PHP script execution mode

Newest hot stuff from Facebook’s HHVM (Hip Hop Virtual Machine for PHP) is to run PHP scripts through HHVM using FastCGI. That’s a huge performance win for any supported PHP application. See http://www.hhvm.com/blog/1817/fastercgi-with-hhvm for a comparison of performance using Wordpress.

Would be really nice if we could choose HHVM as another PHP script execution mode in virtual servers Website Options. What do you think?

They say that “HHVM” uses PHP opcode caching. So I’d be interested how HHVM fares compared to Apache with FastCGI and e.g. XCache active. Otherwise it’s a very unfair comparison.

Also, introducing a new PHP execution mode is a rather big step and requires very careful testing, for compatibility, interoperability and security in a Virtualmin environment.

I’m currently using Nginx and HHVM with Virtualmin. I had to edit the file “/usr/share/webmin/virtualmin-nginx/virtual_feature.pl” in order for it to default to HHVM but it works well and I have no issues with it.

Here are the edits I made starting with line 247:

my $ploc = { ‘name’ => ‘location’,
‘words’ => [ ‘~’, ‘.(hh|php)$’ ],
‘type’ => 1,
‘members’ => [
{ ‘name’ => ‘fastcgi_keep_conn’,
‘words’ => [‘on’],
},
{ ‘name’ => ‘fastcgi_pass’,
‘words’ => [‘127.0.0.1:9000’],
},
{ ‘name’ => ‘fastcgi_index’,
‘words’ => [‘index.php’],
},
{ ‘name’ => ‘fastcgi_param’,
‘words’ => [‘SCRIPT_FILENAME’, ‘$document_root$fastcgi_script_name’],
},
{ ‘name’ => ‘include’,
‘words’ => [‘fastcgi_params’],
},
],
};

i’d also like to use hhvm with apache on centos.

But would that not mean that all the files are executed by whoever is running the hhvm process (in my case that would be www-data) and as such breaking the security on multiuser-systems?

Would it not be the better way to setup a user specific hhvm process per virtualmin hosted site?
AFAIK this is the case with the fast-cgi processes currently in use.

mikt,

Unfortunately you currently can’t setup HHVM to run as user specific process per virtual server. I have been discussing this with the HHVM developers to get this implemented.

I`m interested in this feature too. My current setup is to run Nginx and FCGId. Switching to hhvm may be really nice performance boost.

I now have hhvm running for each website - you need to do that manually - but it works fine!

It would be nice to have this feature accessible through Virtualmin interface :slight_smile:

any update on this?

HHVM has at least double in performance comparing with PHP5.6 + opcache enabled. In my opinion Virtualmin users need a solution for using HHVM as well as default setup. Please share your thoughts to find a way to get this working. Thank you.