[英]HHVM Slower than PHP
I have replaced Apache + modphp to nginx + HHVM. 我已经将Apache + modphp替换为nginx + HHVM。 The original site was running between 1-2 seconds for the html document alone (from curl and FF). 仅html文档(来自curl和FF),原始站点的运行时间为1-2秒。 With HHVM it is now running at 14-20 seconds. 使用HHVM,它现在可以运行14-20秒。
This is all operating on Ubuntu 14.04. 这些都可以在Ubuntu 14.04上运行。 With stock php.ini and server.ini 带有库存的php.ini和server.ini
Here are some configs: 以下是一些配置:
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
}
This is using CodeIgniter as the framework. 这使用CodeIgniter作为框架。
There can be lots of weird effects here that heavily depend on your app... but in general, this really shouldn't be happening. 这里可能有很多怪异的效果,在很大程度上取决于您的应用程序……但是总的来说,这确实不应该发生。 Some quick things to try: 一些快速的尝试:
top
can help you figure this out, to a first approximation: which process is consuming CPU? top
可以帮助您弄清楚这一点:哪个进程在消耗CPU? Or, if none of them are, where is that time going? 或者,如果都不是,那时间要去哪里?
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.