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

MUC session cache problems

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Blocker Blocker
    • 2.4.6, 2.5.2
    • 2.4.5, 2.5.1, 2.6
    • Caching
    • MOODLE_24_STABLE, MOODLE_25_STABLE, MOODLE_26_STABLE
    • MOODLE_24_STABLE, MOODLE_25_STABLE
    • wip-MDL-41106-m26
    • Hide
      1. Download test-sessioncache.php and put it in the Moodle root directory.
      2. On a stable master site (without this patch) visit the test script in your browser several times and take note of the average time.
      3. Move to integration master or apply this patch and repeat.
      4. Ensure there is a reduction in the time, hopefully a big one.
      5. Run unit tests.
      6. Browse the site to ensure things still work as they did before.
      Show
      Download test-sessioncache.php and put it in the Moodle root directory. On a stable master site (without this patch) visit the test script in your browser several times and take note of the average time. Move to integration master or apply this patch and repeat. Ensure there is a reduction in the time, hopefully a big one. Run unit tests. Browse the site to ensure things still work as they did before.

      Tests showed that doing multiple set() into session cache takes enourmous amount of time and RAM.
      cache::make() returns instance of cache_session.
      cache_session::set() adds the new key to the $this->session unconditionally (without checking any maxsizes).
      Then during the call to cache_sessionstore::set() the key is actually the sessionid and the data is the whole session. So there is always only one key and all checks for maxsize are useless.

      This means that doing the second call to $cache->set() will write both first and second data. Calling set() for the third time will write first, second and third, and so on. No wonder tests show that average time for set() call is increasing when number of calls increases.

            samhemelryk Sam Hemelryk
            marina Marina Glancy
            Marina Glancy Marina Glancy
            Damyon Wiese Damyon Wiese
            Rossiani Wijaya Rossiani Wijaya
            Votes:
            1 Vote for this issue
            Watchers:
            6 Start watching this issue

              Created:
              Updated:
              Resolved:

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