Very bad gradebook performance (Moodle 2.8 and 2.9)

Very bad gradebook performance (Moodle 2.8 and 2.9)

by Ewout ter Haar -
Number of replies: 7
Our Moodle 2.8 site has become very difficult to use for teachers and admins due to the very long time it takes to re-calculate the gradebook (minutes). The gradebook is also recalculated when putting tutors in cohorts and in many other situations.

Context: Moodle 2.8.8 (i.e., post 2.8.4), MySQL, courses with 300 studentes * 100 gradeitems + complicated categories and aggregations.

Result of making 1 change: DB reads/writes: 70868/43297 DB queries time: 120.40607. Almost 100k queries? What's it doing?! Why 3 queries per grade? If I change a weight (say), surely I don't need to update or select all grades, I only need to touch the aggregations, right?

I thought maybe something was wrong with our database (this site is upgraded continuously since M2.2), so I installed a Moodle 2.9.2, created a course with a 1000 students and 10 gradeitems *with grades* (this is essential, I used the patch from MDL-47911).

Result of making a change: 29306/21018 DB queries time: 41.78441 secs So, again, 3 or 4 queries and updates per grade.

Is there anything I can do? This really makes our instances of Moodle 2.8 very difficult to use. I wonder if nobody else is seeing this: there must be a lot of Moodle admins with 100s of students and 10s of gradeitems. Maybe I'm overlooking something obvious? 

I notice MDL-47911 is closed and that development of MDL-48838 and MDL-48839 seem to have stalled. There's also MDL-49324 .



In reply to Ewout ter Haar

Re: Very bad gradebook performance (Moodle 2.8 and 2.9)

by Helen Foster -
Picture of Core developers Picture of Documentation writers Picture of Moodle HQ Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers Picture of Translators

Hello Ewout,

I am sorry to hear about your very bad gradebook performance. Unfortunately I can't suggest anything that you can do, however I have commented on the unresolved issues that you mention in the hope that developers will reply.

In reply to Helen Foster

Re: Very bad gradebook performance (Moodle 2.8 and 2.9)

by Ewout ter Haar -

Thanks, Helen. I posted it here to see if other people with large gradebooks had similar experiences. Maybe I'll take it to the developer forum later.

By the way, something I did not mention was this post suggesting turning of class averages ("show column averages"). That may be helpful for people who find this post via google.

I did that, but the problem is not the displaying of the gradebook, it's the recalculation that takes place everytime something happens (putting tutores in a cohort, recalculating a quiz, changing a weight, etc. etc.).

Oh, here's another ticket MDL-50773 reporting the same issue.


In reply to Ewout ter Haar

Re: Very bad gradebook performance (Moodle 2.8 and 2.9)

by Stephen Bourget -
Picture of Core developers Picture of Plugin developers Picture of Testers

There are two other issues you may be interested looking at MDL-51498 and MDL-51584.  MDL-51498, which was fixed yesterday, helps address the number of queries during a regrade. MDL-51584 currently under development focuses on the speeding up the regrade operation.


-Steve

In reply to Ewout ter Haar

Re: Very bad gradebook performance (Moodle 2.8 and 2.9)

by Nate Baxley -

I can second that this is a problem.  We've been hoping it was just a few problem instructors, but we're digging in now to find a solution because our large courses are almost unusable in some cases.  Especially when calculated grade items are concerned.  I'll be looking over the tickets mentioned.

In reply to Ewout ter Haar

Re: Very bad gradebook performance (Moodle 2.8 and 2.9)

by David Monllaó -

Thanks for sharing your case Ewout.


About MDL-48838 and MDL-48839, I didn't have time to return to them, they will be only master and not ready until 3.1, although the good news is that the issues Stephen commented about (MDL-51498 and MDL-51584) are getting integrated (not 100% sure if MDL-51584 will be backported though) you could try latest 2.8 weekly as MDL-51498 is already integrated.

In reply to Ewout ter Haar

Re: Very bad gradebook performance (Moodle 2.8 and 2.9)

by David Monllaó -

Ewout, another important one MDL-51514, this should land in stables, not only master

In reply to David Monllaó

Re: Very bad gradebook performance (Moodle 2.8 and 2.9)

by Ewout ter Haar -

Very encouraging that there is active interest and movement to resolve this issue. We updated to 2.8.8+ and also applied the patch from MDL-51514 (which should be integrated soon). In our tests, this led to a 20-30% speedup of the re-calculation of one of our gradebooks.

No miracles, but progress!