extremely slow HHVM, Wordpress, Nginx
Asked Answered
J

1

7

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.

Jethro answered 5/8, 2014 at 19:45 Comment(3)
Have you tried adding concurrency to your ab test? Also, remove the jit_warmup_requests config. You won't benefit from some of the optimizations this way. Finally, is the error_log empty?Indefinite
Its about the same speed when I add the -c 5 option to the ab test.Jethro
And what happens when you increase concurrency? does hhvm start to outperform? make sure you do not have jit_warmup_requests disabled or 0. Use the default values, and run ab once for warmup, and once again to get the results.Indefinite
J
8

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.

Jethro answered 21/8, 2014 at 15:40 Comment(2)
Faced the same issues with Vagrant, now shifted all my dev environment - as well as production - to Docker. Huge difference in performance so you might like to consider checking that out.Monochord
@Justin Please accept your own answer if you solved your problem!Dominate

© 2022 - 2024 — McMap. All rights reserved.