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

Speed up database installation

    XMLWordPrintable

    Details

    • Type: Improvement
    • Status: Open
    • Priority: Minor
    • Resolution: Unresolved
    • Affects Version/s: 3.9.5
    • Fix Version/s: None
    • Component/s: Installation
    • Labels:
      None
    • Affected Branches:
      MOODLE_39_STABLE

      Description

      When using Moodle with docker and OSX, the time it takes to install the database is exceptionally slow if the moodle directory is a volume on the host.

      Profiling a database installation for phpunit shows that get_files is called excessively.

      This excessive calling of "get_files" is because core_component:get_plugin_list_with_file does not utilise static caching for enough files in the static member $filemap.
      Currently the files to map are defined as follows:

      protected static $filestomap = array('lib.php', 'settings.php');

      db/cache.php is requested excessively during the installation.
      Other files include db/mobile.php and environment.xml.

      Changing $filestomap as follows decreases the install time from 20 minutes to 4 minutes:

      protected static $filestomap = array('lib.php', 'settings.php', 'db/caches.php', 'db/mobile.php', 'environment.xml');

      NOTE: This issue is not a problem where the file system is native. I'm guessing it could affect windows + docker too although I don't have a windows machine to test it on.

        Attachments

          Activity

            People

            Assignee:
            Unassigned Unassigned
            Reporter:
            brudinie guy thomas
            Participants:
            Component watchers:
            Matteo Scaramuccia, Andrew Lyons, Dongsheng Cai, Huong Nguyen, Jun Pataleta, Michael Hawkins, Shamim Rezaie, Simey Lameze
            Votes:
            2 Vote for this issue
            Watchers:
            4 Start watching this issue

              Dates

              Created:
              Updated: