extremely slow HHVM, Wordpress, Nginx

2019-04-07 22:26发布

问题:

I might be doing something wrong but I am doing a bit of testing between a php-fpm wordpress setup and a HHVM wordpress setup. I've heard & seen many mind blowing results from HHVM, but I'm just shocked at the results I'm getting.

Using the following apache testing command I'm getting a much higher performance rate from php-fpm than HHVM.

ab -n1000 http://127.0.0.1:8080/

For php-fpm I am getting 109.98 requests/second.

Unfortunately for me I'm getting only ~12.33 requests/second with HHVM.

These tests are done on a standard fresh Wordpress install. I must be doing something wrong in my configuration. I just need a fresh pair of eyes to see if I'm not doing something right.

Setup

Vagrant instance from my local Macbook. Ubuntu Server 14.04.1 LTS 1GB RAM 1 CPU Nginx MySQL

HHVM Config

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

Nginx Config

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;
}

Any help is appreciated! Thank you.

回答1:

Okay so I finally figured out why this is happening...

It is not HHVM that is slow. I am using Vagrant and setting up a shared directory between my host and guest OS. VirtualBox shared folders are extremely SLOW!!! When I placed all my Wordpress files in a different private directory and pointed Nginx to it my requests/second dramatically increased.