Moodle 5 slow performance despite good server resources

Moodle 5 slow performance despite good server resources

by Eamon dwe -
Number of replies: 5

Dear Moodle Support Team,

I hope you are well.

We recently upgraded our platform from Moodle 4.2 to Moodle 5, and since the upgrade we have experienced a clear and consistent performance slowdown across the entire site.

Previously on Moodle 4.2, the system was fast and stable on the same infrastructure. The degradation started only after moving to Moodle 5.

Affected areas

  • Dashboard (/my)

  • Course pages

  • Course category listings

  • Login and session redirects
    Both guest and logged-in users are affected.

Server environment

  • CPU: Multi-core dedicated server 8

  • RAM: 24 GB

  • Storage: SSD 1.2

  • Web stack: Nginx + Apache (Plesk)

  • PHP: 8.3 with OPcache enabled

  • Database: MariaDB with tuned InnoDB buffer pool

  • Caching:

    • Redis configured for Moodle sessions and application cache

    • PHP OPcache active

    • Cloudflare enabled

Server resource usage (CPU, RAM, disk I/O) appears normal and not saturated.

Observed behaviour

  • Slower TTFB compared to Moodle 4.2

  • Pages take longer to render even when cached

  • No major plugin errors or PHP warnings visible

Questions

  1. Are there known performance changes or heavier background processes introduced in Moodle 5?

  2. Are there new recommended PHP, database, or Redis settings specific to Moodle 5?

  3. Are there core debugging or profiling tools recommended for identifying bottlenecks in Moodle 5?

  4. Is this behaviour expected under Moodle 5’s new architecture?

We would appreciate guidance on optimizing Moodle 5 or identifying the root cause of this slowdown.

Thank you for your assistance.

Kind regards,
Eamon

Average of ratings: -
In reply to Eamon dwe

Moodle 5 slow performance despite good server resources

by Sergio Rabellino -
Picture of Particularly helpful Moodlers Picture of Plugin developers

I didn't notice any change in performance using Moodle 5.x, and I'm not aware of any reason or code change that could impact so deeply.

In reply to Eamon dwe

Moodle 5 slow performance despite good server resources

by Brett Dalton -
Picture of Moodle HQ Picture of Particularly helpful Moodlers
Have the tasks that are used to migrate the question banks with the new structures finished running post the upgrade? This will slow down your system for some time post upgrade depending on the number of quiz questions you have in your system. There was some issues with a couple of performance regressions in Moodle 4.5 to the current versions but have largely been resolved in the last minors. What exact version have you upgraded to? It should also be noted that more data has been moved to by cached so you may find that Redis needs increased memory/storage as well, it will be worth checking if that is a bottle neck.
Average of ratings: Useful (1)
In reply to Brett Dalton

Moodle 5 slow performance despite good server resources

by Eamon dwe -
Moodle 5 is slow mainly because of its large core JavaScript files (core/first.js, yui-moodlesimple-min.js) and polyfills, which load on every page. These files are heavy and block rendering, causing slow Largest Contentful Paint (LCP) and high Total Blocking Time (TBT). Theme scripts are small in comparison, so most of the performance issues come from Moodle’s core,
In reply to Eamon dwe

Moodle 5 slow performance despite good server resources

by Marcus Green -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers
Those features have been in Moodle for many years, why would they make Moodle 5 slower than previous versions?
In reply to Eamon dwe

Moodle 5 slow performance despite good server resources

by Leon Stringer -
Picture of Core developers Picture of Particularly helpful Moodlers

Moodle 5 is slow mainly because of its large core JavaScript files (core/first.js, yui-moodlesimple-min.js) and polyfills, which load on every page.

These are required for every page but should get cached by the browser:

List of HTTP requests for Moodle page, GET yui_combo.php?rollup/3.18.1/yui-moodlesimple-min.css (cached); GET first.js (cached)

Check Theme Designer Mode isn't enabled.

Average of ratings: Useful (2)