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

opcache_reset is not friendly with other applications on same server

    XMLWordPrintable

Details

    • Improvement
    • Status: Closed
    • Minor
    • Resolution: Won't Fix
    • 2.6.6, 2.7, 2.8
    • None
    • Libraries

    Description

      Hello,

      here at Universidade Federal de Santa Catarina we run several Moodle instalations in same host, in a way that they share the same OPCache memory.
      We were used to run on APC and had no problems, but since the change to OPCache, the plugin installation and moodle version upgrades are causing us trouble because it resets the entire cache (712MB) and it causes a big load on our server.

      There are two things to discuss here:

      1. A way to be more friendly with other applications on same server

      For this, we have tested the following script that invalidates all files within a Moodle installation instead of reseting the entire cache:

      $cache = opcache_get_status();
      foreach($cache['scripts'] AS $script=>$arr) {
          if ((strpos($script, $CFG->dirroot) === 0) ||
              (strpos($script, $CFG->dataroot) === 0)) {
              opcache_invalidate($script);
          }   
      }
      

      2. The real reasons why we need to invalidate/reset the cache since Moodle requires opcache.validate_timestamps = 1.

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              danielneis Daniel Neis Araujo
              David Woloszyn, Huong Nguyen, Jake Dallimore, Meirza, Michael Hawkins, Raquel Ortega, Safat Shahin, Stevani Andolo
              Votes:
              2 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: