benchmark-php
benchmark-php copied to clipboard
A benchmark isn't a benchmark w/out something to compare against
If users post their results, we'll all have something to compare against. Here is one from me to get it started.
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 |
On a Ubuntu 14.04 Bitnami Magento 2.2 installation running on Microsoft Azure with Standard B2s VM size.
Test on a mac book pro php-fpm with MariaDB installed:
Just a quick note: For security reasons the server name and IP address should be made unrecognizable.
@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
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:
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.
Dev Server
1 core ( VirtualBox - Ryzen 7 1700 @ 3.00GHz )
1 core ( VirtualBox - Ryzen 7 1700 @ 3.80GHz )
Main Production Server
2 core (Xeon Gold 6136 @ 3.00GHz)
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 Make sure that xdebug is not enabled (on your dev server).
@odan, I did get a notice about that when I first ran benchmark-php and disabled it for these tests. Thanks for mentioning that!
Does anyone knows how to make the string test after?
SiteGround, server stats unknown
Note however: the disk read speed is 600-750MB/s based on dd if=/dev/zero of=test bs=64k count=64k conv=fdatasync
Serverless mysql amazon setup
In a VM with ProxMox (Real machine : core i5 4570, VM : 4 core, 4gb ram)
000webhost free site