-
Bug
-
Resolution: Fixed
-
Major
-
4.1.3, 4.2
MDL-55580 introduced a process for deprecating a capability, which uses $cache->has($capabilityname) to determine if a capability is deprecated.
There are two problems:
- has_capability is called quite often and each call causes at least one cache lookup. We observed a 2-3x increase in our server load avg after upgrading to Moodle 4.1 (Apache, PHP-FPM, Postgres and memcached on one server). Our monitoring system detected 400 million cache misses in memcached by the end of a day (we had only 2 million misses per day before).
- Using a cache key "deprecated_capabilities_initialised" (which determines whether the whole deprecatedcapabilities cache has been loaded into the cache) is not reliable. We cannot be sure that cache key B is still available, just because A is available.