I’m glad Etsy found this before the rest of us had to.
Most PHP SAPIs are implemented such that each request is handled by exactly one process, with many processes simultaneously handling many requests.
HHVM is a threaded SAPI. HHVM runs as a single process with multiple threads where each thread is only handling exactly one request. When you call setlocale(3) in this context it affects the locale for all threads in that process. As a result, requests can come in and trample the locales set by other requests as illustrated in this animation.
HHVM pays of. It’s more than twice as fast as PHP 5.4 in my benchmarks. But, it’s not a drop-in replacement for PHP-FPM.
As with everything: testing, testing & testing.