phpnginxhhvmhiphop

HHVM response latency increase after 12 hours between requests


I'm running HHVM 3.1.0 via nginx 1.6.0 on a CentOS 6.4 system.

I know when you load a php file for the first time, (or first few time depending on the number of JIT warmup passes you configure to wait) the response is slow, but once compilation has occurred, subsequent requests are much faster.

One thing I noticed is once the request have speed up, they stay fast for a while, but if I wait overnight and try to run requests again, it performs as if the code was never compiled--just like restarting the HHVM daemon.

Does HHVM have something like a 'compile lifetime' that re-compiles code after a certain number of requests or time? If so, is there any setting way to control this? Obviously, on production machines once your cache is warmed up and all you PHP code has been JIT compiled, you don't want to incur these cost again until code changes.

For reference, I've included my HHVM config ini file:

 ; php options

 pid = /var/run/hhvm/pid
 date.timezone="America/New_York"
 ; hhvm specific

 hhvm.server.file_socket=/var/run/hhvm/hhvm.sock
 ;hhvm.server.port = 9000
 hhvm.server.type = fastcgi
 hhvm.server.default_document = index.php
 hhvm.log.level = Warning
 hhvm.log.always_log_unhandled_exceptions = true
 hhvm.log.runtime_error_reporting_level = 8191
 hhvm.log.use_log_file = true
 hhvm.log.file = /var/log/hhvm/error.log
 hhvm.log.header = true
 hhvm.repo.central.path = /var/run/hhvm/hhvm.hhbc
 hhvm.mysql.typed_results = false

 hhvm.eval.jit_warmup_requests = 0

Solution

  • Ok, giant egg on my face. The issue I was having was with the cache in the database, not HHVM. On restart (like during backup) the Mysql query cache gets lost, hence overall page slow down. Sometimes it's right in front your face...