[英]HHVM Slower than PHP
我已经将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作为框架。
这里可能有很多怪异的效果,在很大程度上取决于您的应用程序……但是总的来说,这确实不应该发生。 一些快速的尝试:
top
可以帮助您弄清楚这一点:哪个进程在消耗CPU? 或者,如果都不是,那时间要去哪里?
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.