13

I'm trying to migrate from PHP 5.4 (with FPM as FastCGI and apc) on nginx to HHVM - FastCGI (nginx too).

My application is an ad server with Slim as a framework. The ad server is connecting to redis, to memcached (for socket and http), to MySQL, to MongoDB (these endpoints are disabled in HHVM version), to our Java Backend using SOAP and to beanstalkd.

The application has a test endpoint, which calculates a Fibonacci series, after the request 11 the speed is fantastic!

But... The benchmarks of the other endpoints are worse in hhvm (after the request 11, of course).

I'm thinking that is always hhvm mode interpreter on.

Some ideas?

Thanks!

The environment:

8 processors and 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

I compiled the hhvm because I modified phpredis:

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

The tests:

Fibonacci Test

PHP

1.1112360954285

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

Geolocation Test (SOAP)

PHP

Endpoint time
0.011466026306152
SOAP connection time
0.0031890869140625

HHVM

1 Endpoint time
0.26668095588684
1 SOAP connection time
0.017861127853394

2 Endpoint time
0.059494972229004
2 SOAP connection time
0.0069239139556885

3 Endpoint time
0.058794975280762
3 SOAP connection time
0.007004976272583

4 Endpoint time
0.057528972625732
4 SOAP connection time
0.0068209171295166

5 Endpoint time
0.059458017349243
5 SOAP connection time
0.0067899227142334

6 Endpoint time
0.058032035827637
6 SOAP connection time
0.0068209171295166

7 Endpoint time
0.060270071029663
7 SOAP connection time
0.0065340995788574

8 Endpoint time
0.062243938446045
8 SOAP connection time
0.0065720081329346

9 Endpoint time
0.060788869857788
9 SOAP connection time
0.009145975112915

10 Endpoint time
0.065010070800781
10 SOAP connection time
0.007810115814209

11 Endpoint time
0.057285785675049
11 SOAP connection time
0.0065789222717285

12 Endpoint time
0.057971000671387
12 SOAP connection time
0.0066900253295898
Jerodev
  • 29,019
  • 11
  • 72
  • 94

2 Answers2

1

I helped the Facebook HHVM team resolve this exact same problem at around the exact same time you were experiencing it: August 2014.

The issue was resolved in HHVM 3.5, in January 2015.

See my issue: https://github.com/facebook/hhvm/issues/3515

Theodore R. Smith
  • 18,715
  • 12
  • 52
  • 81
0

I wouldn't make the move. I had a client running wordpress (http://www.yourengagement101.com/) that was suffering performance issues. It was running on lamp/ubuntu/ec2:lb and was getting over 50,000 unique a day. After installing and configuring FPM it's been stable and on going.

It depends on what you're getting and what you're trying to get accomplished. Although your scientific patterns seems interesting but the benchmark seems to be an issue. Whatever the case is in my personal experience I've tried many, including zend server optimizer which I had no luck with and despise with passion.

Being on Amazon, we we able to lb requests to 2 diff db/web servers which helped us put out the fire although non of it was planned.

unixmiah
  • 2,808
  • 1
  • 8
  • 25