我在 CentOS 6.4 系统上通过 nginx 1.6.0 运行 HHVM 3.1.0。
我知道当您第一次加载 php 文件时(或前几次取决于您配置等待的 JIT 预热通道的数量)响应很慢,但是一旦发生编译,后续请求会快得多。
我注意到的一件事是,一旦请求加速,它们会保持快速一段时间,但如果我等待一夜并再次尝试运行请求,它的执行就像代码从未编译过一样——就像重新启动 HHVM 守护程序一样。
HHVM 是否有类似“编译生命周期”的东西,可以在一定数量的请求或时间后重新编译代码?如果是这样,是否有任何设置方法来控制它?显然,在生产机器上,一旦缓存预热并且所有 PHP 代码都经过 JIT 编译,在代码更改之前,您不希望再次产生这些成本。
作为参考,我已经包含了我的 HHVM 配置 ini 文件:
; 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