Categories
Magento

HHVM NOW STANDARD ON OUR MAGENTO VPS CONTAINERS. HHVM MAGENTO CONTAINERS

Dx3webs is pleased to announce that all our Magento optimized VPS servers now come with HHVM as a standard option. This allows even faster running of your magento store.

As you will know if you have followed our blog or twitter feed we are really excited about the development of HHVM and the improvements that it offers over PHP.  In our testing we are seeing big improvements with identical installations of Magento when running php.  In particular the more intensive the php (reindexing / high load) the greater the improvement in through put) After a lot of testing we have now decided to make this available on our Magento Optimized VPS containers.  Our VPS servers are based on VMware containers  built on Dual Intel Xeon E5-2630, 32GB Memory, 4x Samsung 840 SSD RAID 10.

HHVM is an open-source virtual machine designed for executing programs written in Hack and PHP. HHVM uses a just-in-time (JIT) compilation approach to achieve superior performance while maintaining the development flexibility that PHP provides.

HHVM is now at version 3.1.0 and is 100% compatible with the default Magento code base (versions 1.x to 1.9x tested).  However, please note your extensions may use php extensions that are not compatible with HHVM.

FLEXIBLE MAGENTO VPS CONTAINERS

We have integrated HHVM into our customised Plesk control panel in a manner that allows the end use to switch between a range of php and web server combinations.  The following combinations are all possible depending on your needs.

  • Nginx proxing to Apache running Mod_php 5.4
  • Nginx proxing to Apache running fastcgi with php version 5.2  5.4 5.5 5.6
  • Apache running Mod_php 5.4
  • Apache running fastcgi with php version 5.2  5.4 5.5 5.6
  • Nginx and HHVM

Each combination has its place depending on your site and your needs. Note that different domains / sub-domains can run different combinations of the above.  So you may have a legacy app that runs on office.mydomains.com that need php 5.2 while running your www.mydomain.com at break neck speed with nginx and HHVM

As always we will help you optimize your site so it runs at its best possible speed.

ACTIVATING HHVM

To activate HHVM simply log into your Dx3webs plesk panel and select Websites and Domains.  For the domain in question select Web Server Settings and you will see the following option.

activate hhvm

Please note that once selected your .htaccess files will no longer be processed so you will need to add appropriate code to your nginx config file.  You can add this to the “Additional nginx directives” on the same screen.  A typical set up for Magento would be (taken directly from the Magento wiki):

# Taken from http://www.linux-magazin.de/Ausgaben/2012/01/Magento-Hosting/(offset)/4
# gzip compression
gzip on;
gzip_min_length 1100;
gzip_buffers 4 8k;
gzip_proxied any;
gzip_types text/plain text/css application/x-javascript text/javascript application/json;

############################################
## uncomment next line to enable light API calls processing
#rewrite ^/api/([a-z][0-9a-z_]+)/?$ /api.php?type=$1 break;

############################################
## rewrite API2 calls to api.php (by now it is REST only)
rewrite ^/api/rest /api.php?type=rest last;

############################################
## TRACE and TRACK HTTP methods disabled to prevent XSS attacks
if ($request_method ~ “^TRAC[EK]”) {
return 405;
}

############################################
## always send 404 on missing files in these folders
if ($uri !~ “^/(media|skin|js)/”) {
set $rewrite_to_index 1;
}

###########################################
## Deny access to release notes to prevent disclosure of the installed Magento version
if ($uri ~* “/RELEASE_NOTES.txt”) {
return 404;
}

# Don’t rewrite if file exists
if (-e $request_filename) {
set $rewrite_to_index 0;
}

############################################
## rewrite everything else to index.php
if ($rewrite_to_index = “1”) {
rewrite / /index.php;
}

############################################
## Prevent character encoding issues from server overrides
## If you still have problems, use the second line instead
charset off;
#charset utf-8;

############################################
## Add default Expires header
## http://developer.yahoo.com/performance/rules.html#expires
expires 365d;

##Taken from http://wiki.nginx.org/Magento
# Hide the system directories
location ~ ^/(app|includes|lib|media/downloadable|pkginfo|report/config.xml|var)/ {
internal;
}

# Hide the hidden files
location /. {
return 404;
}

Feel free to benchmark Magento Community 1.9 and Magento Community 1.8.1.0 running on HHVM via our DxV1 VPS server here:

Magento Community 1.9

Magento Community 1.8.1.0