Uploaded image for project: 'Moodle'
  1. Moodle
  2. MDL-23754 Performance improvements META
  3. MDL-25249

Calendar Pollutes Sessions, Causing Saved Sessions To Waste 99% Of Disk Space

    Details

    • Type: Sub-task
    • Status: Closed
    • Priority: Blocker
    • Resolution: Fixed
    • Affects Version/s: 1.9, 2.0
    • Fix Version/s: 2.1
    • Component/s: Calendar
    • Labels:
    • Testing Instructions:
      Hide

      Basic (functionality) testing instructions:

      Site with admin, teacher, student access (teacher and student enrolled in multiple courses)

      • as admin create some site events and also some course event. Test the calendar block, the upcoming events block and the calendar page shows all the information properly.
      • as teacher enrolled in various courses create some events of all the types allowed. Test the calendar block, the upcoming events block and the calendar page shows all the information (own and admin one) properly.
      • repeat as student (the information from previous steps should be visible. But personal events, of course.

      Surely there are more but this should cover the thingy more or less to detect any immediate regression.

      Show
      Basic (functionality) testing instructions: Site with admin, teacher, student access (teacher and student enrolled in multiple courses) as admin create some site events and also some course event. Test the calendar block, the upcoming events block and the calendar page shows all the information properly. as teacher enrolled in various courses create some events of all the types allowed. Test the calendar block, the upcoming events block and the calendar page shows all the information (own and admin one) properly. repeat as student (the information from previous steps should be visible. But personal events, of course. Surely there are more but this should cover the thingy more or less to detect any immediate regression.
    • Difficulty:
      Difficult
    • Affected Branches:
      MOODLE_19_STABLE, MOODLE_20_STABLE
    • Fixed Branches:
      MOODLE_21_STABLE
    • Pull Master Branch:
      wip-MDL-25249-master-r1

      Description

      A lot of our sessions were curiously large, sometimes approaching 2 megabytes per session. Because sessions are read and rewritten on every request that uses the session, this generates a fair bit of traffic. After decoding the stored session information, I walked the session looking for the culprit. cal_courses_shown appeared to be the largest offender, so I wrote a test script which evaluated the top 10 sessions at the time. The number in the parentheses is the "before" size. The number after "Now:" is the "after" size. The only change that I made to the session was to run the following line of code:

      unset($_SESSION['SESSION']->cal_courses_shown);

      My results follow:

      _Start_

      Session #1 (1282077)
      Now: 5251 (99.59% savings)

      Session #2 (1113736)
      Now: 5449 (99.51% savings)

      Session #3 (870381)
      Now: 5489 (99.37% savings)

      Session #4 (487920)
      Now: 5658 (98.84% savings)

      Session #5 (451477)
      Now: 5143 (98.86% savings)

      Session #6 (440864)
      Now: 5300 (98.80% savings)

      Session #7 (255664)
      Now: 5915 (97.69% savings)

      Session #8 (255311)
      Now: 5562 (97.82% savings)

      Session #9 (255211)
      Now: 5462 (97.86% savings)

      Session #10 (255160)
      Now: 5411 (97.88% savings)

      _End_

        Gliffy Diagrams

          Attachments

            Issue Links

              Activity

                People

                • Votes:
                  3 Vote for this issue
                  Watchers:
                  7 Start watching this issue

                  Dates

                  • Created:
                    Updated:
                    Resolved:
                    Fix Release Date:
                    1/Jul/11