Uploaded image for project: 'Moodle'
  1. Moodle
  2. MDL-70243

Add a file system performance summary into the footer and file IO debug mode

    XMLWordPrintable

    Details

    • Testing Instructions:
      Hide

      1) Turn debugging on

      2) Hack any file such as /index.php and add an error which includes a path:

      print_error('some error /var/www/moodle.local ');

      3) Run this page in the browser and confirm the error shown has a redacted path:

      error/some error [dirroot]   

      4) Turn perfdebug in admin/settings.php?section=debugging

      5) In the footer confirm you see a new extra table with a breakdown of each major file path used by moodle and what sort of IO it has consumed

      6) Purge the caches

      php admin/cli/purge_caches.php

      7) Reload the page and note the expected increase in file IO

      8) Load the /my/ a couple times until the file IO has stabilized

      9) Edit /my/index.php and add this line near the top which loads a ~1.8meg file

      file_get_contents($CFG->libdir . '/tcpdf/fonts/freeserif.z');

      10) Reload the page and confirm in the footer that the dirroot entry for Read has increased by 1.8meg. Remove the hack

      11) Put in a similar hack in the same place doing a 1 meg write:

      file_put_contents($CFG->dataroot . '/test.dat', random_bytes(1024 * 1024));

      12) Confirm in the table you see 1024 kb Write in the dataroot row

       

      File IO logging

      13) Tail the error logs and confirm there is no extra noise, keep the logs open

      14) In config.php add a line

      $CFG->debugfileio = 3;

      15) Reload /my/ and confirm you get some lines in the log eg:

      ... FILEIO [2] miss /var/lib/sitedata/moodle.local/pix/t/message.png /my/ * line 2262 of /lib/outputlib.php: call to file_exists()

      (Note these are issues that will be fixed in MDL-68719)

      16) To see exactly where the issues are set this in config.php

      $CFG->debugfileiostacksize = 20;

      17) Now reload /my/ and you should see a full stacktrace to help pin point where these errant reads are coming from

      18) Set the level to 15 (get ready for spam!)

      $CFG->debugfileio = 15;

      19) Confirm the error log is a firehose of very verbose IO logging. Turn this off again.

      20) In the footer you should see that datadir is red and this is due to the component cache, lets move that to somewhere local:

      $CFG->alternative_component_cache = '/tmp/component';

      21) Reload twice and this should remove the red row

       

       

      Show
      1) Turn debugging on 2) Hack any file such as /index.php and add an error which includes a path: print_error('some error /var/www/moodle.local '); 3) Run this page in the browser and confirm the error shown has a redacted path: error/some error  [dirroot]     4) Turn perfdebug in admin/settings.php?section=debugging 5) In the footer confirm you see a new extra table with a breakdown of each major file path used by moodle and what sort of IO it has consumed 6) Purge the caches php admin/cli/purge_caches.php 7) Reload the page and note the expected increase in file IO 8) Load the /my/ a couple times until the file IO has stabilized 9) Edit /my/index.php and add this line near the top which loads a ~1.8meg file file_get_contents($CFG->libdir . '/tcpdf/fonts/freeserif.z'); 10) Reload the page and confirm in the footer that the dirroot entry for Read has increased by 1.8meg. Remove the hack 11) Put in a similar hack in the same place doing a 1 meg write: file_put_contents($CFG->dataroot . '/test.dat', random_bytes(1024 * 1024)); 12) Confirm in the table you see 1024 kb Write in the dataroot row   File IO logging 13) Tail the error logs and confirm there is no extra noise, keep the logs open 14) In config.php add a line $CFG->debugfileio = 3; 15) Reload /my/ and confirm you get some lines in the log eg: ... FILEIO [2] miss /var/lib/sitedata/moodle.local/pix/t/message.png /my/ * line 2262 of /lib/outputlib.php: call to file_exists() (Note these are issues that will be fixed in  MDL-68719 ) 16) To see exactly where the issues are set this in config.php $CFG->debugfileiostacksize = 20; 17) Now reload /my/ and you should see a full stacktrace to help pin point where these errant reads are coming from 18) Set the level to 15 (get ready for spam!) $CFG->debugfileio = 15; 19) Confirm the error log is a firehose of very verbose IO logging. Turn this off again. 20) In the footer you should see that datadir is red and this is due to the component cache, lets move that to somewhere local: $CFG->alternative_component_cache = '/tmp/component'; 21) Reload twice and this should remove the red row    
    • Affected Branches:
      MOODLE_311_STABLE
    • Pull 3.11 Branch:
      MDL-70243-debug-filesystem-perf-MOODLE_311_STABLE
    • Pull Master Branch:
      MDL-70243-debug-filesystem-perf

      Description

      Very similar to the caching table with misses, reads, writes, but broken down by each major filesystem path that Moodle can be configured with

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              brendanheywood Brendan Heywood
              Reporter:
              brendanheywood Brendan Heywood
              Participants:
              Component watchers:
              Matteo Scaramuccia, Amaia Anabitarte, Carlos Escobedo, Ferran Recio, Ilya Tregubov, Sara Arjona (@sarjona), Matteo Scaramuccia, Andrew Lyons, Dongsheng Cai, Huong Nguyen, Jun Pataleta, Michael Hawkins, Shamim Rezaie, Simey Lameze
              Votes:
              5 Vote for this issue
              Watchers:
              9 Start watching this issue

                Dates

                Created:
                Updated: