MacBook Air (MBA) Mid 2012
Virtualbox (VB): Ubuntu 12.04.2 LTS (GNU/Linux 3.2.0-23-generic x86_64) via vagrant.
MBA with Apache 2 with mod_php Version 5.3.19 with MySQL 5.5 (MAMP)
VB with fresh pulled HHVM sources with MySQL 5.5
I ran here a big customized Magento EE 1.12 store from a big Swiss scout store. A lot of custom price rules for many different groups and some fancy discount types.
URL schema is different from the official demo store: www.customer.ch/[de|fr]/index.php
to map automatically different languages.
Magento Cache activated. MySQL database slightly optimized via mysqltuner.pl
- 5000 SKUs
- 237 categories
- 48.000 url rewrites
- 4 store views
- FPC disabled
Magento EE sources has been imported into the VM. Not via shared folders or NFS. There were previously some weird long request times with HHVM when using shared folders.
You can use the install script install-hhvm.sh
for compiling and installing hiphop https://github.com/jakoch/php-hhvm.
But change the hiphop source in function get_hiphop_source()
to the special Magento hiphop https://github.com/danslo/hiphop-php source.
Optionally: You can remove all the last lines after ## Success
in the script install-hhvm.sh
.
Official FB "How to" compile: https://github.com/facebook/hiphop-php/wiki
Prebuild packages will not work with Magento.
Options for the config.hdf file: https://github.com/facebook/hiphop-php/blob/master/hphp/doc/options.compiled
Please see the to this gist attached file hhvm.hdf
.
Buggy is the PHP_SELF and SCRIPT_NAME which will not be properly set therefore hardcoded. Also the rewrite rules can be more optimized.
I'm not quite sure if that is still a problem with SimpleXML or with buggy Magento code.
Fixes:
- File
site/app/code/core/Mage/Core/Block/Template/Facade.php
every:$key = (string)$key;
Unfixable:
- There are also some errors in the
site/app/code/core/Mage/Eav/Model/Entity/Collection/Abstract.php on line 441
but that results from strange code in phtml files ... 8-)
Not every category will work but 98% of them.
Not possible due to HHVM shows this error:
Notice: Undefined index: 0 in /var/www/customer-dev/site/app/code/core/Mage/Catalog/Model/Layer/Filter/Price/Algorithm.php on line 368
There is something weird in our code base, not in HHVM.
Multiple shift-reloads in the FF 23 browser in two tabs. Times are approximate.
Request Type | HHVM | MAMP | MAMP-APC [1] |
---|---|---|---|
CMS Page | 450ms | 2.5s | 820ms |
Category View [2] | 980ms | 4.6s | 3.5s |
Product View [3] | 500ms-1s | 4.7s | 3.1s |
Add to basket [4] | 1.2-2.9s | 8.8s | 5.5s |
List basket [5] | 2.1s | 6.9s | 3.8s |
List basket [6] | 1s | 5.5s | 2.9s |
Checkout Onepage [7] | 690ms | 4.47s | |
Onepage SaveBilling | 236ms | 2.3s | |
Onepage SaveShipping | 251ms | 2.4s | |
Onepage SavePayment | 486ms | 3.28s | |
Onepage success | 562ms | 3.25s |
- MAMP-APC runs with PHP 5.4.16
- containing 8 products
- configurable product with two options and one customer rating
- POST to cart with redirect to product view and listing cart content
- First call of the basket page
- Reloads
- Initial load of the page checkout/onepage after that normal checkout process
In both tests: PHP 5.4.16
Type | MAMP-APC | HHVM |
---|---|---|
Concurrency Level | 5 | 5 |
Time taken for tests | 23.229s | 7.334s |
Complete requests | 20 | 20 |
Failed requests | 0 | 0 |
Write errors | 0 | 0 |
Total bytes transferred | 2202440 | 2244160 |
HTML bytes transferred | 2193600 | 2235640 |
Requests per second | 0.86 #/sec mean | 2.73 #/sec mean |
Time per request | 5807.239 ms mean | 1833.474 ms mean |
Time per request (1) | 1161.448 ms | 366.695 ms |
Transfer rate | 92.59 Kbytes/sec received | 298.83 Kbytes/sec received |
(1) mean, across all concurrent requests
Type | MAMP-APC | HHVM |
---|---|---|
Concurrency Level | 5 | 5 |
Time taken for tests | 36.298 | 13.682s |
Complete requests | 20 | 20 |
Failed requests | 0 | 0 |
Write errors | 0 | 0 |
Total bytes transferred | 2002620 | 2118440 |
HTML bytes transferred | 1993780 | 2109920 |
Requests per second | 0.55 #/sec mean | 1.46 #/sec mean |
Time per request | 9074.451 ms mean | 3420.546 ms mean |
Time per request (1) | 1814.890 ms | 684.109 ms |
Transfer rate | 53.88 Kbytes/sec received | 151.20 Kbytes/sec received |
(1) mean, across all concurrent requests
Missing is a test where we rely on Redis, Percona, php-fpm + nginx.
Also missing test: The HHVM should be put behind a nginx server and even here the cache should connect to Redis.
Facebook is working hard on HHVM. A lot of commits take place every day!
Big kudos to https://twitter.com/daniel_sloof for fixing HHVM errors related to Magento!
That would be one future for PHP.
@patadeloso he's running EE 1.12 not Community
@SchumacherFM have you tried this on EE 1.13+ yet?