Advertisement:

Author Topic: SMF-Benchmark  (Read 1413 times)

Offline albertlast

  • Development Contributor
  • Jr. Member
  • *
  • Posts: 171
SMF-Benchmark
« on: September 14, 2017, 06:00:04 PM »
Link to Mod

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

Offline vbgamer45

  • SMF Friend
  • SMF Super Hero
  • *
  • Posts: 19,343
    • smfhacks on Facebook
    • VBGAMER45 on GitHub
    • @createaforum on Twitter
    • SMF For Free
Re: SMF-Benchmark
« Reply #1 on: September 14, 2017, 06:50:55 PM »
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

Offline Gryzor

  • Sr. Member
  • ****
  • Posts: 723
  • Gender: Male
  • CPCwiki.eu - The Amstrad CPC Encyclopaedia!
    • CPCWiki
Re: SMF-Benchmark
« Reply #2 on: September 15, 2017, 01:01:45 PM »
Oh, how very interesting! Any chance of a 2.0.x version?

Offline albertlast

  • Development Contributor
  • Jr. Member
  • *
  • Posts: 171
Re: SMF-Benchmark
« Reply #3 on: September 16, 2017, 04:08:44 PM »
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...

Offline Gryzor

  • Sr. Member
  • ****
  • Posts: 723
  • Gender: Male
  • CPCwiki.eu - The Amstrad CPC Encyclopaedia!
    • CPCWiki
Re: SMF-Benchmark
« Reply #4 on: September 17, 2017, 04:28:16 AM »
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!

Offline albertlast

  • Development Contributor
  • Jr. Member
  • *
  • Posts: 171
Re: SMF-Benchmark
« Reply #5 on: September 28, 2017, 04:24:32 PM »
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

Offline albertlast

  • Development Contributor
  • Jr. Member
  • *
  • Posts: 171
Re: SMF-Benchmark
« Reply #6 on: October 01, 2017, 10:24:30 AM »
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

Code: [Select]
<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)
Code: [Select]
if (!isset($_SESSION['optimized_tables']))
validateToken('admin-maint');
else
validateToken('admin-optimize', 'post', false);
and replace this with

Code: [Select]
/*
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:
Code: [Select]
//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.

Offline g4gt

  • Newbie
  • *
  • Posts: 6
Re: SMF-Benchmark
« Reply #7 on: November 15, 2017, 03:23:14 PM »
help ,how can I install on fresh 2.0.14...getting error when tring to install :(

Offline d3vcho(void)

  • Localizer
  • SMF Hero
  • *
  • Posts: 2,241
  • Gender: Male
  • Be prepared for hell
    • d3vcho on GitHub
    • @SMF_ES on Twitter
Re: SMF-Benchmark
« Reply #8 on: November 15, 2017, 03:34:38 PM »
This mod doesn't work for any 2.0.xx versions. Just for SMF 2.1 Beta 3.