Benchmarking performance

Benchmarking performance

بواسطة - Martin Dougiamas
عدد الردود: 11
صورة Core developers صورة Documentation writers صورة Moodle HQ صورة Particularly helpful Moodlers صورة Plugin developers صورة Testers
For quick benchmarking I have these lines in my test sites (including moodle.org  غمزة )

At the top of header.html:
   <?php $CFG->startpagetime = microtime(); ?>

Near the bottom of footer.html:
    <?php
    if (isadmin()) {
        echo "<p align=right><font size=-3>";
        echo microtime_diff($CFG->startpagetime, microtime());
        echo "</font></p>";
    }
?>


متوسط التقييمات: -
رداً على Martin Dougiamas

Re: Benchmarking performance

بواسطة - Martin Dougiamas
صورة Core developers صورة Documentation writers صورة Moodle HQ صورة Particularly helpful Moodlers صورة Plugin developers صورة Testers
For detailed analysis of the database, there is a new monitoring feature in ADOdb.

You can run this very easily - the following script can go in your moodle root folder:

<?php
    include_once('config.php');

    require_login();
    if (isadmin()) {
        $perf =&NewPerfMonitor($db);
        $perf->UI($pollsecs=5);
    } else {
        error("Sorry, admins only.");
    }

?>

رداً على Martin Dougiamas

Re: Benchmarking performance

بواسطة - Ger Tielemans

Nice, I put it behind a button on the administration overview page.

If I press trhe button I get this screen. Great, what does it mean?

المرفق screen.png
رداً على Ger Tielemans

Re: Benchmarking performance

بواسطة - Martin Dougiamas
صورة Core developers صورة Documentation writers صورة Moodle HQ صورة Particularly helpful Moodlers صورة Plugin developers صورة Testers
All of your database tables are of type MyISAM, so you can ignore the other types.  99.688% cache hit ratio is excellent!
رداً على Martin Dougiamas

Re: Benchmarking performance

بواسطة - Ger Tielemans

Thanks, I will sent your compliments to my Linux administrator.

We have sometimes problems with the clock, for example when a teachers creates a quizz with a time window and the clock is not in synch with real life: would be nice to have a date & timechecker in the administration-menu, to check now and then.

(A date/time checker AND resetter is asking to much?)

I now use these two open sources for clock and date, each behind a button,

  • but I am not sure if they are looking at the right place
  • it is not language independant 
رداً على Martin Dougiamas

Re: Benchmarking performance

بواسطة - Kam Vento
Am I missing something. I cut and pasted the code into a standard html doc named bench.php and placed it in the moodle root. Got the following error: Fatal error: Call to undefined function: login()

Suspect it doesn't find the include file "config.php" This Moodle lives on the ISP website. Any hints are always appreciated. I think my slow performance issues might be with the mysql database and I sure would like to benchmark it.

Thanks
رداً على Kam Vento

Re: Benchmarking performance

بواسطة - Martin Dougiamas
صورة Core developers صورة Documentation writers صورة Moodle HQ صورة Particularly helpful Moodlers صورة Plugin developers صورة Testers
I agree your config.php line is probably not right.

I've put this into the main distribution now, as cvs:/moodle/admin/dbperformance.php, so try that.
رداً على Martin Dougiamas

Re: Benchmarking performance

بواسطة - Kam Vento
Martin
Thanks for the incredibly fast responsesmileapprove

Your new script works like a charm, I've attached a capture of the results. Doesn't look like I can blame MySql for the problem. Although I still suspicious of the database because it sometimes takes a long time to login or logout.
المرفق bench.jpg
رداً على Martin Dougiamas

Re: Benchmarking performance

بواسطة - Kam Vento

Can we modify the above code with an sprintf() to show a friendly time. I'm afraid I don't know how to calculate this number: 1069347663.7799

رداً على Kam Vento

Re: Benchmarking performance

بواسطة - Ger Tielemans

Maybe You forgot to place in header.html of your styleset:

 <?php $CFG->startpagetime = microtime(); ?>

رداً على Ger Tielemans

Re: Benchmarking performance

بواسطة - Kam Vento
I did forget, kinda of like customs, one needs to declare their valuables, in code one must  declare their variables. Thanks for the comment, its working like it should (even though its running on a Windows Server)smile