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

cron runs 12+hours accessing MySQL

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Major Major
    • 1.9
    • 1.8
    • None
    • Solaris 8, Apache 2.0.59, PHP 4.4.7, APC 3.0.14, MySQL 5.0.41 on Sun V890, 16GB ram. Moodle 1.8+ from 5/23/07 tarball, recently upgraded from 1.6.5+
    • MySQL
    • MOODLE_18_STABLE
    • MOODLE_19_STABLE

      Twice now since I upgraded to 1.8+ a week ago, I have found that cron begins a long-running task at (say) 3:30 AM and it is still running later in the day(12 hours+). The MySQL daemon is consuming at least one whole CPU.I have run a mytop display to see what sort of queries were being made,and it seems be mainly one
      like this:
      SELECT COUNT(DISTINCT prs.userid) FROM (SELECT ra.userid, ra.roleid AS primary_roleid, ra.contextid, r.sortorder, r.name, r.description, r.shortname, c.instanceid AS courseid, c.contextlevel FROM mdl_role_assignments ra INNER JOIN mdl_role r ON ra.roleid = r.id INNER JOIN mdl_context c ON ra.contextid = c.id WHERE NOT EXISTS ( SELECT 1 FROM mdl_role_assignments i_ra INNER JOIN mdl_role i_r ON i_ra.roleid = i_r.id WHERE ra.userid = i_ra.userid AND ra.contextid = i_ra.contextid AND i_r.sortorder < r.sortorder ) ) prs WHERE prs.primary_roleid=3 AND prs.courseid=3279 AND prs.contextlevel = 50 ...................

      What is this all about? I am tempted to kill the php process but since it is the weekend and we are between semesters, I'll let it run for a while longer!

      I should mention that I have observed the lack of some table indexes that are present when 1.8 is installed outright, rather than upgraded. The list seems to be the same as described for Moodle 1.7. Is this a factor?

            skodak Petr Skoda
            jpd James Dugal (Inactive)
            Nobody Nobody (Inactive)
            Votes:
            2 Vote for this issue
            Watchers:
            8 Start watching this issue

              Created:
              Updated:
              Resolved:

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