【发布时间】:2015-05-27 09:57:29
【问题描述】:
我已将 Apache + modphp 替换为 nginx + HHVM。 仅 html 文档(来自 curl 和 FF)的原始站点运行时间在 1-2 秒之间。 使用 HHVM,它现在运行时间为 14-20 秒。
这一切都在 Ubuntu 14.04 上运行。使用库存 php.ini 和 server.ini
这里有一些配置:
location ~ \.(hh|php)$ {
fastcgi_keep_conn on;
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $request_filename; // The only change
include fastcgi_params;
}
server {
#listen stuff
#root stuff
#index stuff
location / {
try_files $uri $uri/ index.php?$query_string;
}
include hhvm.conf
}
这是使用 CodeIgniter 作为框架。
【问题讨论】:
-
问题是?
-
@MarkBaker 为什么著名的 HHVM 的运行速度会比普通的 PHP 5.5 设置慢。
-
因为在您的项目中使用全局变量和动态类型,如果您不遵守规则hhvm performance tips,hhvm 的速度将无法保证
-
@AlexKashin 我知道由于这些问题它不会超快。但是慢了 12 秒?