相关疑难解决方法(0)

HHVM - FastCGI:性能不佳

我正在尝试从PHP 5.4(使用FPM作为FastCGI和apc)在nginx上迁移到HHVM - FastCGI(也是nginx).

我的应用程序是一个以Slim为框架的广告服务器.广告服务器连接到redis,memcached(用于套接字和http),MySQL,MongoDB(这些端点在HHVM版本中禁用),使用SOAP和beanstalkd连接到Java后端.

该应用程序有一个测试端点,计算一个Fibonacci系列,在请求11之后速度非常棒!

但是......其他终端的基准在hhvm中更糟糕(当然,在请求11之后).

我认为这总是hhvm模式解释器.

一些想法?

谢谢!

环境:

8个处理器和8GB RAM.

$ uname -a
Linux 3.13.0-30-generic #55-Ubuntu SMP Fri Jul 4 21:40:53 UTC 2014 x86_64 x86_64 x86_64 GNU/Linux

$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description:    Ubuntu 14.04 LTS
Release:    14.04
Codename:   trusty
Run Code Online (Sandbox Code Playgroud)

我编译了hhvm,因为我修改了phpredis:

$ hhvm --version
HipHop VM 3.2.0-dev (rel)
Compiler: heads/master-0-gb7802e739a1f16808dd06c57754c1dc77ed80054
Repo schema: acdee0ea91d0b5967c60a0a42f5dbf81433a7821
Run Code Online (Sandbox Code Playgroud)

测试:

斐波纳契测验

PHP

1.1112360954285
Run Code Online (Sandbox Code Playgroud)

HHVM

1.7104048728943
1.7193510532379
1.7104179859161
1.713366985321
1.7120008468628
1.7102618217468
1.7118058204651
1.7113170623779
1.7101211547852
1.7117080688477
1.7127840518951
0.10136723518372
Run Code Online (Sandbox Code Playgroud)

地理定位测试(SOAP) …

php performance hhvm

13
推荐指数
1
解决办法
1018
查看次数

非常慢的HHVM,Wordpress,Nginx

我可能做错了,但我在php-fpm wordpress设置和HHVM wordpress设置之间进行了一些测试.我听说过HHVM的许多令人兴奋的结果,但我对我得到的结果感到震惊.

使用以下apache测试命令我从php-fpm获得比HHVM高得多的性能.

ab -n1000 http://127.0.0.1:8080/
Run Code Online (Sandbox Code Playgroud)

对于php-fpm,我得到109.98个请求/秒.

不幸的是,我用HHVM只能得到~12.33次请求/秒.

这些测试是在标准的新Wordpress安装上完成的.我必须在配置中做错事.我只需要一双新眼睛,看看我是不是做对了.

建立

来自我当地Macbook的流氓实例.Ubuntu Server 14.04.1 LTS 1GB RAM 1 CPU Nginx MySQL

HHVM配置

pid = /var/run/hhvm/pid
hhvm.server.file_socket=/var/run/hhvm/hhvm.sock
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.repo.central.path = /var/run/hhvm/hhvm.hhbc
hhvm.mysql.typed_results = false
hhvm.eval.jit_warmup_requests = 0
hhvm.eval.jit = true
Run Code Online (Sandbox Code Playgroud)

Nginx配置

location ~ \.(hh|php)$ {
    fastcgi_pass unix:/var/run/hhvm/hhvm.sock;
    fastcgi_index   index.php;
    fastcgi_param   SCRIPT_FILENAME  $document_root$fastcgi_script_name;
    include         fastcgi_params;
}
Run Code Online (Sandbox Code Playgroud)

任何帮助表示赞赏!谢谢.

php wordpress nginx hhvm

6
推荐指数
1
解决办法
3080
查看次数

标签 统计

hhvm ×2

php ×2

nginx ×1

performance ×1

wordpress ×1