benchmark-php icon indicating copy to clipboard operation
benchmark-php copied to clipboard

A benchmark isn't a benchmark w/out something to compare against

Open jrogers512 opened this issue 7 years ago • 15 comments

If users post their results, we'll all have something to compare against. Here is one from me to get it started.

image

Benchmark
math 1.652
string 2.239
loops 0.072
ifelse 0.133
connect 0.001
select_db 0.001
query_version 0.001
query_benchmark 10.707
total 14.803

jrogers512 avatar Oct 22 '17 03:10 jrogers512

On a Ubuntu 14.04 Bitnami Magento 2.2 installation running on Microsoft Azure with Standard B2s VM size.

image

mysil2 avatar Jan 12 '18 12:01 mysil2

Test on a mac book pro php-fpm with MariaDB installed: image

gshn avatar Jan 25 '18 01:01 gshn

Just a quick note: For security reasons the server name and IP address should be made unrecognizable.

odan avatar Jan 25 '18 09:01 odan

screen shot 2018-01-25 at 10 04 09 am

tinyhazeleyes avatar Jan 25 '18 15:01 tinyhazeleyes

@odan I love the simplicity of this and the way you have written it. I saw this issue by @jrogers512 and saw what he was trying to accomplish by starting this thread, but this still isn't really a decent way to compare results.

On first glance though, while I’m sure you have plenty to do, I can see a relatively easy way to accomplish a REAL benchmark/comparison, without effecting your scripts performance. Would just take a bit of your time to write. This could be a great way to see just how many people are using your script, as well as something to actually compare results to. FYI, this is the first result when you search google for "php mysql benchmark", so it probably gets some use.

My idea is, add a form to your output html with hidden inputs. and pre-populate those inputs using the test results. Name the submit button "Compare Results", and have the form post data to another php file on your own website.,

the php on your website will add the data to an sql database, and you could query it based on the platform, and mysql/php version. You could then average the columns, and present the user with a visual representation (css/js?) of their performance, in comparison to others using the same software.

I guess you'd want perform some data validation to prevent bogus data from being posted and ending up in your tables, be it with malicious intent or just by someone who modified the code and broke it. You could also store a separate table for posts with the client ip and server time, so you could limit posts per IP per day, and avoid any individual abusing resources.

Anyway, just an idea. I'm very new to PHP and mysql, so there's probably far better ways of doing it. that’s just what came to mind and what i thought of when i saw this thread

geelongmicrosoldering avatar Mar 13 '18 20:03 geelongmicrosoldering

Hi @geelongmicrosoldering

but this still isn't really a decent way to compare results.

The original idea of this script was to compare only its own servers.

this is the first result when you search google for "php mysql benchmark"

Cool :-)

representation ... in comparison to others using the same software.

Comparison with foreign servers was never the main goal, but it's sounds interessting. If there are more people who like this idea, I might implement something.

Thanks for your feedback :+1:

odan avatar Mar 14 '18 17:03 odan

The Idea is intresting, and yeah having something to compare would be great to know how good or ugly one's values are.

for example on netcup webhosting the calc total is about 0,4 sec but MySQL is like 8,4, which obviously looks crazily high but as I said without knowing how demanding the bench is (e.g. by seeing how others compare), well I guess you get my point.

My1 avatar Jul 16 '18 21:07 My1

Dev Server 1 core ( VirtualBox - Ryzen 7 1700 @ 3.00GHz ) dev server

1 core ( VirtualBox - Ryzen 7 1700 @ 3.80GHz ) php benchmark

Main Production Server 2 core (Xeon Gold 6136 @ 3.00GHz) production

While this benchmark shows better performance out of the dev server, in real life, PHP scripts run much faster on the production server. For example, the production server can load the WordPress admin in about 140ms while my dev server averages about 400ms; but I suspect some of that has to do with the virtualized environment I am running.

joshrowland avatar Oct 31 '18 20:10 joshrowland

@joshrowland Make sure that xdebug is not enabled (on your dev server).

odan avatar Oct 31 '18 22:10 odan

@odan, I did get a notice about that when I first ran benchmark-php and disabled it for these tests. Thanks for mentioning that!

joshrowland avatar Nov 01 '18 11:11 joshrowland

Does anyone knows how to make the string test after?

image

vgavrilovikj avatar Mar 26 '20 18:03 vgavrilovikj

SiteGround, server stats unknown

image

Note however: the disk read speed is 600-750MB/s based on dd if=/dev/zero of=test bs=64k count=64k conv=fdatasync

Joshfindit avatar Apr 26 '20 17:04 Joshfindit

image

Serverless mysql amazon setup

breakerh avatar Nov 19 '20 11:11 breakerh

Screenshot_20210310-022646

In a VM with ProxMox (Real machine : core i5 4570, VM : 4 core, 4gb ram)

JuneTwooo avatar Mar 10 '21 01:03 JuneTwooo

image 000webhost free site

ishanfdo18098 avatar Feb 06 '22 03:02 ishanfdo18098