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

Deprecated capabilities feature puts high pressure on caches

XMLWordPrintable

      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.

            mgauk Martin Gauk
            mgauk Martin Gauk
            Sam Marshall Sam Marshall
            Andrew Lyons Andrew Lyons
            CiBoT CiBoT
            Votes:
            5 Vote for this issue
            Watchers:
            13 Start watching this issue

              Created:
              Updated:
              Resolved:

                Estimated:
                Original Estimate - Not Specified
                Not Specified
                Remaining:
                Remaining Estimate - 0 minutes
                0m
                Logged:
                Time Spent - 30 minutes
                30m

                  Error rendering 'clockify-timesheets-time-tracking-reports:timer-sidebar'. Please contact your Jira administrators.