Poor PHP benchmark script performance (what's yours?)
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
--------------------------------------
| 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
--------------------------------------
| 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.
| 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.
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
--------------------------------------
| 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.
~~![](<URL url=)
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.~~
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.
--------------------------------------
| 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.
--------------------------------------
| 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.
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!
````
| 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.
--------------------------------------
| 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 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…
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