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

Lots of calls to update course modinfo + sectioncache

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: Major Major
    • None
    • 2.5
    • Course, Performance
    • MOODLE_25_STABLE

      Just a forewarning - this may turn out to be a wild goose chase.

      I've a site that has 501 courses on it.
      Each course has 3 managers, 20 teachers, and 250 students (can you tell I used a script to populate this site).
      The front page is set to show a list of courses for users who are not logged in.

      When viewing the front page without logging in I am seeing 9158 reads, and 1001 writes (consistently).
      The reads is fine, we know that area to be pretty horrid, but the writes looked mighty suspicious.

      I ran a simple hash count on the queries being executed and tracked the writes back to two SQL statements:

      Statement Calls
      UPDATE mdl_course SET modinfo = $1,sectioncache = $2 WHERE id=$3 501
      UPDATE mdl_cache_text SET md5key = $1,formattedtext = $2,timemodified = $3 WHERE id=$4 500

      Cache text lifetime is set to 1 minute and this page is taking 45s+ to generate so the cache_text statement probably makes sense in a (puke) kind of way.
      However I've no clue about the call to update modinfo and section cache. I would guess something is wrong there (why on earth would be update those every single request)

      So the point of this issue, work out why that is happening and see if we can't save a few DB writes.

            Unassigned Unassigned
            samhemelryk Sam Hemelryk
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved:

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