HHVM 50X ERRORS WITH EMPTY LOGS
HHVM has numerous performance benefits when compared to PHP 5.6 and below. For any websites, especially those that cannot be easily updated to suport PHP7, it is an excellent choice to improve performance and capacity.
HHVM was recently deployed on a large Magento store under our management. The store utilised CentOS 7, Nginx 1.9 and HHVM 3.14. We occasionally noticed 502 and 503 errors as HHVM had crashed. After each crash, the logs were empty, making it difficult to find the cause of the crash. It is likely, however, that as HHVM’s implementation of PHP functions deviates from PHP’s, that code and data changes could lead to such crashes.
Unfortunately, debugging HHVM can be challenging as logs generation relies heavily on HHVM’s debug mode, which in turn reduces performance drastically. In our experiments, HHVM’s debug mode increased page load times from around 0.2s to upwards to 2s, making it impossible to use in production.
Having experimented with internal and external HHVM builds, we started to experiement with different versions. We had deployed HHVM 3.14 originally and newer sub-versions did not make a noticeable change. The solution lied in downgrading HHVM to 3.9 which anecdotal evidence suggested was more stable.
Approximately one week later, the 502 and 503 errors are no more. This begs the question of the future of HHVM: it was developed in-house by Facebook for their own use and, although it is an excellent open source contribution, its seems unlikely that its stability and performance record can compete with PHP7.