Two days ago [Wednesday] in mid morning when classes were in session, we had a sudden huge jump in %CPU which then rendered Moodle not accessible as the web service could not respond. We added more CPU's - from 6 to 20 - which helped but still had high usage. We noticed a repeating mysql query of:
SELECT DISTINCT eu1_u.id
FROM mdl_user eu1_u
JOIN mdl_user_enrolments ej1_
eu1_u and ej1 may be differentIn addition our database grew in about 24 hours from a little over 7GB to 45GB.
I did some research and discovered there is/was an issue with Completion tracking and disabled accounts with this same repeating query along with the same increase in %CPU usage by mariadb. We don't have Completion tracking turned on but we do have some disabled accounts. Yesterday day [Thursday] in the morning I altered two of the disabled accounts as they had duplicate username and email addresses of two active accounts. Shortly after that, the SQL query occurrence dropped and within a few hours stopped.
Today [Friday] in mid morning the same thing has started again. And I don't know if what I did the previous day was related at all.
I have deleted all but one disabled accounts ... and the CPU% has dropped by about 1/2 to 1/4 of the highest amount we saw but is not back to normal for sure!
As this happened twice around the same time frame - Wednesday and Friday and not Thursday could there be some event/activity causing this behavior from a Monday, Wednesday, Friday class?? Our classes are typically a MWF or a TTh pattern.
We have been running Moodle on the same number of processors - 6 - over the past three years. This past summer we moved from a CentOS to a Ubuntu server and moved the Moodle app directory and export/imported the database. The moodledata is on a separate storage system and is an NFS mount point. We've made no changes to settings or plugins and so on and we don't do changes during a semester unless there is something urgent. For example, we had to add more storage when Moodle's use increased a lot when the pandemic began to impact the USA in mid March 202.
Thank you for any help, ideas and thoughts - Melanie