News:

Want to get involved in developing SMF, then why not lend a hand on our github!

Main Menu

SMF-Benchmark

Started by albertlast, September 14, 2017, 06:00:04 PM

Previous topic - Next topic

albertlast

Link zur Modifikation

SMF-Benchmark

This mod provide SMF 2.1 with the posibility to check the performance of the enviorment.

Benchmark type
- Create as many users as possible in one minute - cpu heavy test
- Create as many posts as possible in one minute - This test is db insert performance heavy
- Repeatedly access a topic for one minute - This test depends heavily on the size of your board and the active features

Use case
- Changing your php or database version
- Changing your database solution exp. MySQL -> MariaDB
- Changing smf settings exp. different Caching Methods or levels
- Changing your host
- Possible side effect from mods
- To check if your board get slower over time

This mod run on MySQL, MariaDB and PostgreSQL.

After install you find the entry under: Maintenance > Forum Maintenance > Benchmark

GitHub Link


All suggestions related to core features and UI are most welcomed.



License
* This SMF Modification is subject to the BSD 3

vbgamer45

Nice idea would have to check it out.
Community Suite for SMF - Take your forum to the next level built for SMF, Gallery,Store,Classifieds,Downloads,more!

SMFHacks.com -  Paid Modifications for SMF

Mods:
EzPortal - Portal System for SMF
SMF Gallery Pro
SMF Store SMF Classifieds Ad Seller Pro

Gryzor

Oh, how very interesting! Any chance of a 2.0.x version?

albertlast

Since i don't use smf 2.0.x i had no plan to make this work for this.
I try to install my mod on smf 2.0.x but the displaying doesn't work...

Gryzor

Yeah, I figured it wouldn't, so I didn't even try it in the first place :) But thanks for letting us know at least!

albertlast

Maybe for comparison, please hav in mind that is a synthetic benchmark.
smf 2.1 "beta4" pg 9.6 php 7.1 mariadb 10.1

PG is a mid size board
PG Cache lvl3 is a mid size board with pg as cache level 3
MySQL is near fresh
PG fresh is a fresh install






Test
PG
PG Cache lvl3
MariaDB
PG fresh
User Creation
111
113
88
865
Post Creation
5381
9087
75
8263
Post read
7371
12475
19080
17872

albertlast

Because i created this table with benchmark i was interessted in smf 2.0 too.
So setup a clean version of MariaDB with two changes,
convert all tables to innodb and disable caching.

User Creation    316
Post Creation    82
Post read          9130

Since i did it, i know what is needed to run this mod on smf 2.0.x

Three steps (first two steps you find in attachment):
-Add in package-info.xml


<install for="2.0, 2.0.1-2.0.99">
<readme type="file" parsebbc="true">readme.txt</readme>
<require-dir name="Themes" destination="$boarddir">Theme files</require-dir>
<require-dir name="Sources/SMFBenchmark" destination="$sourcedir">Source files</require-dir>
<code>installer/installHooks2.1.php</code>
<redirect url="?action=admin;area=maintain;sa=benchmark" type="inline" timeout="2000">Please stand by while you are being redirected to benchmark side.</redirect>
</install>
<uninstall for="2.0, 2.0.1-2.0.99">
<code>installer/uninstall2.1.php</code>
<remove-dir name="$sourcedir/SMFBenchmark" />
<remove-file name="$themedir/SMFBenchmark.template.php" />
<remove-file name="$languagedir/SMFBenchmark.english.php" />
</uninstall>


- search Class-SMFBenchmark.php for (should be there three times)

if (!isset($_SESSION['optimized_tables']))
validateToken('admin-maint');
else
validateToken('admin-optimize', 'post', false);

and replace this with


/*
if (!isset($_SESSION['optimized_tables']))
validateToken('admin-maint');
else
validateToken('admin-optimize', 'post', false);
*/


- Last step >after< the install of the mod in your board
got to Sources/ManageMaintenance.php
to the end of $subActions array (in smf 2.0.14 this is line 178)
add after this:

//Bechmark
        loadTemplate('SMFBenchmark');

        $context[$context['admin_menu_name']]['tab_data']['tabs']['benchmark'] = array();

        $subActions['benchmark'] = [
                'function' => 'SMFBenchmark::MaintainBenchmark',
                'template' => 'maintain_Benchmark',
                'activities' => [
                        'usercreate' => 'SMFBenchmark::UserCreate',
                        'postcreate' => 'SMFBenchmark::PostCreate',
                        'postread' => 'SMFBenchmark::PostRead',
                ],
        ];
        //end Bechmark


The first two steps i combined in the attachment already,
so you can install the mod and go to step three.

As always i recommand to redo the changes of step three and removed the mod asap,
when you done with testing.

g4gt

help ,how can I install on fresh 2.0.14...getting error when tring to install :(

d3vcho

This mod doesn't work for any 2.0.xx versions. Just for SMF 2.1 Beta 3.
"Greeting Death as an old friend, they departed this life as equals"

albertlast

Changed the version to 1.2
Changelog:
Added Russia
Added Beta4 (github version) support
Place a check if db_show_debug is enabled - don't run the benchmark when you enabled this, when you did you need to restart you webserver after running

alexetgus

Too bad this mod is not planned for SMF 2.0.x ... :'(

albertlast


alexetgus

So you propose a "patch" for an official SMF and a full mod for a beta version.
Okay.
Thank you goodbye !

Bigguy

To use this do I have to:

- Create as many users as possible in one minute - cpu heavy test
- Create as many posts as possible in one minute - This test is db insert performance heavy
- Repeatedly access a topic for one minute - This test depends heavily on the size of your board and the active features
???

albertlast

Why you belief this?
This are different options which the benchmark can run.

Bigguy

OK, if I don't have to run that stuff than I will install this later today at some point.

Arantor

This mod is for seeing how quickly different things work on your server and for testing different ways to do something. I don't think you want this in your production site.

Bigguy

If it's going to mess with stuff than no I don't.

albertlast

No it don't mess up with any stuff,
but since it a benchmark it make no sense to keept it after you run your tests.

Bigguy

I have a test site. I will try it on there and see what happens.

Advertisement: