-
Improvement
-
Resolution: Won't Fix
-
Minor
-
None
-
2.6.6, 2.7, 2.8
-
MOODLE_26_STABLE, MOODLE_27_STABLE, MOODLE_28_STABLE
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.