I have a Moodle 3.6 installation in a LAMP environment (live dedicated server) using PHP 7.2 and MySQL 5.5. The site has never been super fast but since we upgraded it from Moodle 3.2 to Moodle 3.6 we've noticed a significant hit in loading times for certain pages.
Bullets describing the issue and other facts that may be useful:
- Non-course pages load actually pretty fast (home page, admin pages, report pages, etc).
- Course pages load very slow, proportionally to the amount of items they have (which in theory makes sense but not in this way in my opinion).
- For example, the home page of our courses (where all the topics are listed) can take like 10 seconds to load (and it's very consistent in terms of how long). It's a page with lots of items.
- The page that loads all the activities of a topic also loads very low, but not as slow as the course home page.
- The page that loads the contents of an activity loads much faster.
Things that I've done:
- Make sure designer mode is off
- Check server environment and everything is green
-Changed DB engine from MYISAM to INNODB with no change whatsoever
- Checked with browser inspector: most time is spent waiting for first byte
- Profiling: enabled PHP Tideways extension and run some profiling, but I'm not super sure how to interpret that. Looks like the delay comes from the database queries but I'm not sure how can that be fixed (I'm attaching a screenshot of a profiling run of the course home page in case someone ca see something helpful).
Any ideas what I can look into to speed up the site? Currently it has 4 big courses but I don't think big enough by any means to produce this slowness...
