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

Cron performance problems after upgrading to Moodle 2.2.x

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Minor Minor
    • 2.2.3
    • 2.2.2
    • Roles / Access
    • None
    • MOODLE_22_STABLE
    • MOODLE_22_STABLE
    • Hide

      1. Make a test script like

      <?php
      require_once('config.php');
      context_helper::build_all_paths(true);
      echo 'done';

      run it, and verify that there are no errors.

      2. Change the 'true' to 'false', and run the script again.

      3. Go in to the context table, find two rows with contextlevel = 30 (user). In one set depth to 0, and in the other set path to NULL. Run the 'false' version of the test script again. Make sure it sets the data back to the correct values.

      4. Again, edit rows in the user table, but set depth to something silly, like 100, and path to a random string. Run the 'true' version of the test script again. Make sure it sets the data back to the correct values.

      Show
      1. Make a test script like <?php require_once('config.php'); context_helper::build_all_paths(true); echo 'done'; run it, and verify that there are no errors. 2. Change the 'true' to 'false', and run the script again. 3. Go in to the context table, find two rows with contextlevel = 30 (user). In one set depth to 0, and in the other set path to NULL. Run the 'false' version of the test script again. Make sure it sets the data back to the correct values. 4. Again, edit rows in the user table, but set depth to something silly, like 100, and path to a random string. Run the 'true' version of the test script again. Make sure it sets the data back to the correct values.

      Cron and accesslib.php were both changed substantially in Moodle 2.2.

      One bit in particular has been causing us problems since we upgraded from 2.1.x this morning. In cron-lib, there are now calls to

      context_helper::cleanup_instances(); // Line 149 of lib/cronlib.php
      context_helper::build_all_paths(false); // Line 151 of lib/cronlib.php
      context_helper::create_instances(); // Line 183 of lib/cronlib.php

      At least one of thase calls was bringing down our server, but we are not 100% sure which. We commented out all three lines of code, and now running cron does not bring down the server, and we don't really want to experiment enabling them one at a time, and see which crashes our live systemwink

      See http://moodle.org/mod/forum/discuss.php?d=199830 for more info.

            timhunt Tim Hunt
            timhunt Tim Hunt
            Petr Skoda Petr Skoda
            Dan Poltawski Dan Poltawski
            Jason Fowler Jason Fowler
            Votes:
            1 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved:

                Error rendering 'clockify-timesheets-time-tracking-reports:timer-sidebar'. Please contact your Jira administrators.