Poor PHP benchmark script performance (what's yours?)

This is a separate question, possibly related the the issue I was experiencing in my other thread.

I'm on a Linode 1024 in Newark, and it was suspected that one of my VPS neighbors was hogging resources, or there was an issue with the host. Running the benchmark script at http://www.php-benchmark-script.com/ on my own server, I was getting pretty consistently bad results. Here's a typical result:

--------------------------------------
|        PHP BENCHMARK SCRIPT        |
--------------------------------------
Start : 2014-01-29 01:23:13
Server : 
PHP version : 5.3.10-1ubuntu3.9
Platform : Linux
--------------------------------------
test_math                 : 10.459 sec.
test_stringmanipulation   : 15.231 sec.
test_loops                : 7.115 sec.
test_ifelse               : 5.976 sec.
--------------------------------------
Total time:               : 38.781 sec.

It seems like other users have also had issues with PHP performance on their Linodes.

After migrating to another host, my webpage response times and overall performance are definitely better, so there was an issue with the host. However, I'm not sure if it was CPU related. On the new host, I sometimes get total times as low as 12 seconds, but running the test a few more times, I've still gotten total times in the 30 second range. On my old host, things were so bad that the test sometimes wouldn't complete. I understand that the availability of burstable resources can result in variability, but even with the modest amount of guaranteed resources that I'm supposed to have with the VPS, I would have expected better performance–or at least the Linode being able to finish the benchmark! I'm curious what all of you are getting on your Linode ____ boxes (benchmark script is above).

The best I've done on the new server:

-------------------------------------- 
| PHP BENCHMARK SCRIPT | 
--------------------------------------
Start : 2014-01-29 03:02:10
Server : 
PHP version : 5.3.10-1ubuntu3.9 
Platform : Linux 
------------------------------
--------
test_math                 : 3.753 sec.
test_stringmanipulation   : 3.840 sec.
test_loops                : 2.630 sec.
test_ifelse               : 2.079 sec.
--------------------------------------
Total time:               : 12.302 sec.

15 Replies

FWIW- 1024 in Atlanta still running Debian Squeeze (yeah- I know)

--------------------------------------
|        PHP BENCHMARK SCRIPT        |
--------------------------------------
Start : 2014-01-29 08:21:50
Server : @
PHP version : 5.3.24-1~dotdeb.0
Platform : Linux
--------------------------------------
test_math                 : 4.072 sec.
test_stringmanipulation   : 3.903 sec.
test_loops                : 2.481 sec.
test_ifelse               : 2.128 sec.
--------------------------------------
Total time:               : 12.584 sec.

Remember that this benchmark will only use 1 thread - but fwiw here's mine:

|        PHP BENCHMARK SCRIPT        |
--------------------------------------
Start : 2014-01-29 14:34:41
Server : @
PHP version : 5.5.0
Platform : Linux
--------------------------------------
test_Math                 : 2.858 sec.
test_StringManipulation   : 3.453 sec.
test_Loops                : 1.431 sec.
test_IfElse               : 1.023 sec.
--------------------------------------
Total time:               : 8.765 sec.

linode1024 fremont

ubuntu 12.04 [kernel 3.9.3-x86_64-linode33]

--------------------------------------
|        PHP BENCHMARK SCRIPT        |
--------------------------------------
Start : 2014-01-29 13:39:06
Server : @
PHP version : 5.5.8-3+sury.org~precise+1
Platform : Linux
--------------------------------------
test_math                 : 1.915 sec.
test_stringmanipulation   : 1.936 sec.
test_loops                : 1.072 sec.
test_ifelse               : 0.869 sec.
--------------------------------------
Total time:               : 5.792 sec.

from iostat

avg-cpu:  %user   %nice %system %iowait  %steal   %idle
           0.11    0.01    0.15    0.07    0.30   99.36

Thank you for posting your data. Seems like bryantrv and I are on the shorter end of the stick, but at least it's somewhere in the ballpark of your numbers.

Linode 1024 London:

--------------------------------------
|        PHP BENCHMARK SCRIPT        |
--------------------------------------
Start : 2014-01-30 11:37:49
Server : @
PHP version : 5.3.10-1ubuntu3.9
Platform : Linux
--------------------------------------
test_math                 : 14.134 sec.
test_stringmanipulation   : 15.207 sec.
test_loops                : 8.050 sec.
test_ifelse               : 7.364 sec.
--------------------------------------
Total time:               : 44.755 sec.

m1.micro eu-west1 (Ireland):

--------------------------------------
|        PHP BENCHMARK SCRIPT        |
--------------------------------------
Start : 2014-01-30 11:40:12
Server : @
PHP version : 5.3.3
Platform : Linux
--------------------------------------
test_math                 : 3.735 sec.
test_stringmanipulation   : 3.338 sec.
test_loops                : 2.484 sec.
test_ifelse               : 1.814 sec.
--------------------------------------
Total time:               : 11.371 sec.

m1.small eu-west1 (Ireland):

--------------------------------------
|        PHP BENCHMARK SCRIPT        |
--------------------------------------
Start : 2014-01-30 11:39:06
Server : @
PHP version : 5.3.10-1ubuntu3.9
Platform : Linux
--------------------------------------
test_math                 : 4.563 sec.
test_stringmanipulation   : 4.881 sec.
test_loops                : 4.100 sec.
test_ifelse               : 2.959 sec.
--------------------------------------
Total time:               : 16.503 sec.

Digital Ocean 1GB New York 1:

--------------------------------------
|        PHP BENCHMARK SCRIPT        |
--------------------------------------
Start : 2014-01-30 10:46:24
Server : @
PHP version : 5.5.3-1ubuntu2
Platform : Linux
--------------------------------------
test_math                 : 1.438 sec.
test_stringmanipulation   : 1.546 sec.
test_loops                : 0.992 sec.
test_ifelse               : 0.858 sec.
--------------------------------------
Total time:               : 4.834 sec.

Not exactly a scientific test though. Not all the machines above were fully idle, running the same OS, and the same version of PHP.

EDIT: Pretty up the formatting.

EDIT2: The Linode and the m1.small are both running the same OS and the same PHP version. Both were idle. As the Linode has 8 E5-2670 cores @ 5202.85 bogomips and the m1.small only 1 E5-2650 @ 3599.99 bogomips the Linode should have been faster.

That's pretty interesting, sednet. Your Linode instance is basically performing as poorly as mine did, and my response times for a fairly light MediaWiki installation which runs on PHP and MySQL went from ~500ms (not spectacular to begin with) up to around 2000ms, I believe due to a server issue:

~~![](<URL url=)http://classic.dryang.org/images/2014-0 … e_time.gif">http://classic.dryang.org/images/2014-01responsetime.gif" />

These requests needed to get data from the database, and much of the added response time was just the various speed test/checking software options waiting for a response from the server.

As soon as I migrated to another box, things improved and went back to the way they were. I don't know how long a non-bursting idle Linode 1024 should take for the benchmark, but I can't imagine that it's normal for it to take that long. This raises the question of whether there could be an issue with the virtualization that prevents one VPS from having access to a certain level of dedicated/reserved resources it's supposed to have because another VPS is running resource-intensive tasks. It's almost like it's more of a shared hosting environment rather than VPS….

I'd be curious if a Linode staff member would comment about some of these concerns, which I acknowledge are speculative.~~

Linode 1024 London

Atrocious result (after running it 3 times).

My linode was idle when running the benchmark.

Host cpu is Xeon L5520 @ 2.27GHz

--------------------------------------
|        PHP BENCHMARK SCRIPT        |
--------------------------------------
Start : 2014-04-01 20:36:30
Server : @
PHP version : 5.3.10-1ubuntu3.10
Platform : Linux
--------------------------------------
test_math                 : 37.702 sec.
test_stringmanipulation   : 44.696 sec.
test_loops                : 23.463 sec.
test_ifelse               : 17.192 sec.
--------------------------------------
Total time:               : 123.053 sec.

My Apple laptop at home

--------------------------------------
|        PHP BENCHMARK SCRIPT        |
--------------------------------------
Start : 2014-04-01 20:35:58
Server : @
PHP version : 5.3.28
Platform : Darwin
--------------------------------------
test_math                 : 1.903 sec.
test_stringmanipulation   : 2.396 sec.
test_loops                : 1.602 sec.
test_ifelse               : 1.315 sec.
--------------------------------------
Total time:               : 7.216 sec.

Generic shared web hoster (Priorweb)

--------------------------------------
|        PHP BENCHMARK SCRIPT        |
--------------------------------------
Start : 2014-04-01 21:02:00
Server : @
PHP version : 5.3.22-1~dotdeb.0
Platform : Linux
--------------------------------------
test_math                 : 2.573 sec.
test_stringmanipulation   : 2.582 sec.
test_loops                : 1.533 sec.
test_ifelse               : 1.389 sec.
--------------------------------------
Total time:               : 8.077 sec.

I opened a support ticket for a migration.

Late to the party but what the heck. Just ran the script after upgrading from XEN to KVM

--------------------------------------
|        PHP BENCHMARK SCRIPT        |
--------------------------------------
Start : 2015-08-01 10:56:14
Server : XXXXXXXXXXX
PHP version : 5.6.9-0+deb8u1
Platform : Linux
--------------------------------------
test_math                 : 1.590 sec.
test_stringmanipulation   : 1.452 sec.
test_loops                : 0.867 sec.
test_ifelse               : 0.495 sec.
--------------------------------------
Total time:               : 4.404 sec.

Mine- same server after KVM switch:

--------------------------------------
|        PHP BENCHMARK SCRIPT        |
--------------------------------------
Start : 2015-08-01 13:10:20
Server : @
PHP version : 5.4.43-1~dotdeb+7.1
Platform : Linux
--------------------------------------
test_math                 : 1.657 sec.
test_stringmanipulation   : 1.625 sec.
test_loops                : 1.121 sec.
test_ifelse               : 0.783 sec.
--------------------------------------
Total time:               : 5.186 sec.

…and just seeing how mine compares, after moving [virtually] from London to Frankfurt

LONDON [before]:

--------------------------------------
|        PHP BENCHMARK SCRIPT        |
--------------------------------------
Start : 2015-08-01 10:56:14
Server : XXXXXXXXXXX
PHP version : 5.6.9-0+deb8u1
Platform : Linux
--------------------------------------
test_math                 : 1.590 sec.
test_stringmanipulation   : 1.452 sec.
test_loops                : 0.867 sec.
test_ifelse               : 0.495 sec.
--------------------------------------
Total time:               : 4.404 sec.

FRANKFURT [after]:

--------------------------------------
|        PHP BENCHMARK SCRIPT        |
--------------------------------------
Start : 2015-08-04 09:04:24
Server : XXXXXXXXXXX
PHP version : 5.6.9-0+deb8u1
Platform : Linux
--------------------------------------
test_math                 : 1.548 sec.
test_stringmanipulation   : 1.479 sec.
test_loops                : 0.842 sec.
test_ifelse               : 0.495 sec.
--------------------------------------
Total time:               : 4.364 sec.

Yay! 0.04 seconds faster.

Result! :mrgreen:

````

| PHP BENCHMARK SCRIPT |

Start : 2016-01-04 13:42:54
Server : @
PHP version : 5.6.14-0+deb8u1

Platform : Linux

testmath : 1.128 sec. teststringmanipulation : 1.122 sec.
test_loops : 0.763 sec.

test_ifelse : 0.448 sec.

Total time: : 3.461 sec.
````

Just purchased a Linode 1024 a few days ago and finished setting up most of the basic stuff.

This is Nginx + PHP5.6 + FastCGI FPM. Pretty darn fast.

I'm on Linode 1024 in Fremont, CA that I setup about a month ago with Nginx and HHVM. It's been over a year since the last reply to this thread, and I'm not sure why my node is so much faster. Has the hardware and/or virtualization gotten that much better or is it HHVM vs PHP?

--------------------------------------
|        PHP BENCHMARK SCRIPT        |
--------------------------------------
Start : 2017-09-28 05:00:10
Server : @
PHP version : 5.6.99-hhvm
Platform : Linux
--------------------------------------
test_math                 : 0.307 sec.
test_stringmanipulation   : 0.577 sec.
test_ifelse               : 0.036 sec.
test_loops                : 0.083 sec.
--------------------------------------
Total time:               : 1.003 sec.

The first two tests (math & stringmanipulation) are normal for the linode 1-thread cpu.

The other two tests (ifelse & loops) are indeed extremely low, for example PHP 7.1 does 0.290 sec on those tests, so I'm guessing that HHVM's preprocessor/JIT optimizes the code much better than PHP 7.1. But that is just a guess…

HHVM is significantly faster than PHP 5.6, however with PHP 7.x it is much closer.

Linode 1G in London, KVM, PHP 7.0.24

--------------------------------------
|        PHP BENCHMARK SCRIPT        |
--------------------------------------
Start : 2017-10-09 21:10:52
Server : N/A
PHP version : 7.0.24-1~16.04
Platform : Linux
--------------------------------------
test_ifelse               : 0.247 sec.
test_loops                : 0.314 sec.
test_stringmanipulation   : 0.410 sec.
test_math                 : 0.286 sec.
--------------------------------------
Total time:               : 1.257 sec.

````

| PHP BENCHMARK SCRIPT |

Start : 2017-11-16 12:04:06
Server : @
PHP version : 7.1.11-1+ubuntu16.04.1+deb.sury.org+1

Platform : Linux

testmath : 0.319 sec. teststringmanipulation : 0.443 sec.
test_loops : 0.293 sec.

test_ifelse : 0.205 sec.

Total time: : 1.26 sec.
````

Linode 8192, Frankfurt

Reply

Please enter an answer
Tips:

You can mention users to notify them: @username

You can use Markdown to format your question. For more examples see the Markdown Cheatsheet.

> I’m a blockquote.

I’m a blockquote.

[I'm a link] (https://www.google.com)

I'm a link

**I am bold** I am bold

*I am italicized* I am italicized

Community Code of Conduct