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

opcache_reset is not friendly with other applications on same server

XMLWordPrintable

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

      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.

            Unassigned Unassigned
            danielneis Daniel Neis Araujo
            Votes:
            2 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.