vanilla-php / benchmark-php

:rocket: A benchmark script for PHP and MySQL (Archived)
MIT License
192 stars 90 forks source link

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

Open jrogers512 opened 7 years ago

jrogers512 commented 7 years ago

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
mysil2 commented 6 years ago

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

image

gshn commented 6 years ago

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

odan commented 6 years ago

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

tinyhazeleyes commented 6 years ago

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

geelongmicrosoldering commented 6 years ago

@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

odan commented 6 years ago

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:

My1 commented 6 years ago

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.

joshrowland commented 5 years ago

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.

odan commented 5 years ago

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

joshrowland commented 5 years ago

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

vgavrilovikj commented 4 years ago

Does anyone knows how to make the string test after?

image

Joshfindit commented 4 years ago

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

breakerh commented 3 years ago

image

Serverless mysql amazon setup

JuneTwooo commented 3 years ago

Screenshot_20210310-022646

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

ishanfdo18098 commented 2 years ago

image 000webhost free site