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.

Justin Workman
  • 380
  • 3
  • 6
  • 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? – Sina Aug 10 '14 at 23:34
  • Its about the same speed when I add the -c 5 option to the ab test. – Justin Workman Aug 13 '14 at 18:12
  • 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. – Sina Aug 13 '14 at 21:08

1 Answers1

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.

Justin Workman
  • 380
  • 3
  • 6
  • 1
    Faced the same issues with Vagrant, now shifted all my dev environment - as well as production - to [Docker](https://www.docker.com). Huge difference in performance so you might like to consider checking that out. – mulkave Aug 30 '14 at 14:32
  • @Justin Please accept your own answer if you solved your problem! – BenMorel Nov 04 '14 at 16:03