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

XMLWordPrintable

    • Icon: Sub-task Sub-task
    • Resolution: Fixed
    • Icon: Blocker Blocker
    • 2.1
    • 1.9, 2.0
    • Calendar
    • MOODLE_19_STABLE, MOODLE_20_STABLE
    • MOODLE_21_STABLE
    • wip-MDL-25249-master-r1
    • Difficult
    • 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.

      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_

        1. MDL25249.patch
          8 kB
          John Kelsh
        2. moodle_trim_calendar_data_from_session.patch
          0.6 kB
          Jonathan Champ

            samhemelryk Sam Hemelryk
            jrchamp Jonathan Champ
            Eloy Lafuente (stronk7) Eloy Lafuente (stronk7)
            Glenn Ansley Glenn Ansley
            Votes:
            3 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:
              Resolved:

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