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

Cron - do gc_collect_cycles between tasks, and report memory usage

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 2.3.4, 2.4.1
    • Fix Version/s: 2.5
    • Component/s: Libraries
    • Labels:
    • Testing Instructions:
      Hide

      Run cron:

      1. Using the CLI mode.
      2. Throuh the web interface.

      Confirm that it still works, and that the extra information displayed is helpful.

      Show
      Run cron: 1. Using the CLI mode. 2. Throuh the web interface. Confirm that it still works, and that the extra information displayed is helpful.
    • Affected Branches:
      MOODLE_23_STABLE, MOODLE_24_STABLE
    • Fixed Branches:
      MOODLE_25_STABLE
    • Pull from Repository:
    • Pull Master Branch:

      Description

      These are two things we have done at the OU, but they are probably useful to everyone, so putting them up for review.

      1. PHP is not great at garbage collection. We have found in the past that adding calls to gc_collect_cycles() at appropriate places can really help long-running PHP processes, and cron.php falls into that category.

      2. Before and after each chunk of cron, output the current time and current memory usage. Then, when cron gets slow, or uses a lot of memory, you can easily see where the problem might be.

        Gliffy Diagrams

          Attachments

            Activity

              People

              • Votes:
                0 Vote for this issue
                Watchers:
                5 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Fix Release Date:
                  14/May/13