creation and deletion of courses is very slow

creation and deletion of courses is very slow

by elvys cruz -
Number of replies: 3

I manage a large moodle site (50,000+ students) for a university, everything works fine, but creating and deleting courses takes about 1 minute to complete for a single blank course with default settings. One minute to create or delete courses is not acceptable to us as we have to create thousands of courses at the beginning of each semester. Using the web interface or through the command line with moosh takes the same time. I guess it is because of the large amount of data in the DB (~100GB). The course table in MySQL has 45,000+ records. Everything else on the site is fast. Is there anything that can be done to reduce the time needed for course creation and deletion?

Moodle version:  3.10.4
MySQL  5.7.33

Thanks in advance.

Average of ratings: -
In reply to elvys cruz

Re: creation and deletion of courses is very slow

by Giovanni Vosloo -

Hi Elvys,

So after reading your post, it might be that your site size and activity levels are too much for the server itself? Deleting a course and creating a course in a fresh Moodle installation is fairly quick, so my only guess is that perhaps the server cannot do the job fast enough for your site size, you might need to look at upgrading it and judging by the size of your DB alone, you need to look at servers that run 100% SSD, no hybrids or HDD will be good enough.


I hope this information help.

Average of ratings: Useful (1)
In reply to elvys cruz

Re: creation and deletion of courses is very slow

by Visvanath Ratnaweera -
Picture of Particularly helpful Moodlers Picture of Translators
Your Moodle instance contains 45,000 courses? Really? How come? I can imagine that Moodle unit tests do not crunch through such huge data sets.

If you must have such an absurd number of courses, you have to dig further. First make sure that the database consume the time. Then collect the SQL queries it answers. How many? Are there slow queries in them? The Moodle specific methods are well documented in other discussions in this forum. Analyzing databases is a science (and art) which is separate. Find external resources on that.