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

backup/backuplib.php high load due to PHP5 issue

    XMLWordPrintable

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 1.7
    • 1.7.2, 1.8, 1.9
    • Backup
    • None
    • CentOS, latest yummy patches installed. PHP version 5.1.6. Moodle version 1.7 (may possibly be 1.7.1 - "1.7" is just what the dev guys said when I asked).
    • MySQL
    • MOODLE_17_STABLE
    • MOODLE_17_STABLE, MOODLE_18_STABLE, MOODLE_19_STABLE

    Description

      PHP5 introduced new code that "normalizes" paths for inlclude_once and require_once so Windoze systems can avoid case insensitivy problems. This code apparently ends up producing a lot of lstat64() calls as it 'normalizes' the directory paths. This happens very quickly, and would not normally be an issue. However, because of the repeated calls to include_once() within a loop, the end result (on my system at least) is that my sysload goes through the roof (6+) because of the repeated calls to lstat64().

      I have traced down the call in question to the file ./school/backup/backuplib.php and the loop begun on line 1772.

      I am requesting that someone figure out how to do what needs doing here without include_once()'ing fifty million times during backup.

      Thanks - and e-mail me if there is anything else I can do to help. My diagnosis has 'evolved' as I've been working on this, and may yet do so again - but the current situation as outlined above seems to be the final conclusion.

      Attachments

        1. backuplib_patch.patch
          2 kB
          Eloy Lafuente (stronk7)

        Activity

          People

            stronk7 Eloy Lafuente (stronk7)
            adam@khouse.org Adam Lambert
            Nobody Nobody
            Adrian Greeve, Jake Dallimore, Mathew May, Mihail Geshoski, Peter Dias, Sujith Haridasan
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:
              30/Mar/07