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

MUC session cache problems

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Blocker
    • Resolution: Fixed
    • Affects Version/s: 2.4.5, 2.5.1, 2.6
    • Fix Version/s: 2.4.6, 2.5.2
    • Component/s: Caching
    • Labels:
    • Testing Instructions:
      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.
    • Affected Branches:
      MOODLE_24_STABLE, MOODLE_25_STABLE, MOODLE_26_STABLE
    • Fixed Branches:
      MOODLE_24_STABLE, MOODLE_25_STABLE
    • Pull Master Branch:
      wip-MDL-41106-m26

      Description

      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.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              samhemelryk Sam Hemelryk
              Reporter:
              marina Marina Glancy
              Peer reviewer:
              Marina Glancy
              Integrator:
              Damyon Wiese
              Tester:
              Rossiani Wijaya
              Participants:
              Component watchers:
              Matteo Scaramuccia, Amaia Anabitarte, Carlos Escobedo, Ferran Recio, Sara Arjona (@sarjona), Víctor Déniz Falcón
              Votes:
              1 Vote for this issue
              Watchers:
              6 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:
                Fix Release Date:
                9/Sep/13