A slow Moodle site is not solved by one “best” setting. Measure where time is spent, reproduce the problem and change one layer at a time. The bottleneck may be PHP, the database, storage, cache, cron, a plugin, a course page or an external service.
Establish a baseline
Record page response times for anonymous, student and teacher accounts. Test a course page, dashboard, quiz, report and login during normal and peak load. Note concurrent users, server CPU, memory, disk latency, database activity and PHP worker saturation.
Browser developer tools separate server wait time from large images, scripts and third-party requests. Server monitoring shows whether a slow page is isolated or part of system-wide pressure.
Check Moodle’s reports
Review Site administration > Reports > Performance overview and System status. Resolve environment warnings, failing scheduled tasks and a growing ad hoc queue. A heavy background job can compete with live requests even when the page itself is efficient.
Enable PHP OPcache
OPcache stores compiled PHP bytecode so PHP does not parse every script on every request. Confirm it is enabled for the PHP service that runs the website—not only for CLI. Size it for the codebase and monitor resets or exhaustion after plugin changes.
Configure Moodle application caches
Moodle’s Cache API can map cache definitions to stores. Disk-based defaults may be adequate for a small site, but Redis or Memcached can improve suitable application caches when configured and monitored correctly. Do not map every cache blindly; some are local, others must be shared in a cluster.
Use Site administration > Plugins > Caching to review stores, mappings and cache usage. Test changes under realistic load and keep a route back to the default configuration.
Fix slow storage
Database files, PHP code, cache directories and moodledata have different I/O patterns. Slow network storage can make file access and disk-backed caches painful. Use fast local storage where Moodle’s architecture permits it, while preserving required shared storage and locking for clustered nodes.
Tune the database with evidence
Enable slow-query logging for a controlled period and identify repeated expensive queries. Check indexes, buffer sizes, connection pressure, table growth and database statistics with a qualified administrator. Generic configuration copied from another server can make performance worse.
Review PHP workers and the web server
Too few workers create queues; too many can exhaust memory and destabilise the host. Tune PHP-FPM or the relevant process model against measured request memory and available RAM. Configure HTTPS, compression and HTTP keep-alive appropriately, but do not hide slow application responses behind browser caching.
Audit plugins, themes and course design
- Disable or replace abandoned plugins after testing.
- Compare timings with optional blocks removed.
- Avoid dashboards that execute many external requests.
- Compress oversized course images and videos.
- Break exceptionally long course pages into usable sections.
- Test custom reports and question-bank operations separately.
Keep cron frequent and controlled
Run cron every minute so work is processed steadily instead of accumulating into large bursts. Use concurrency limits and task monitoring where appropriate. Schedule resource-heavy backups or reports with awareness of teaching peaks.
Do not optimise by disabling protections
Avoid world-writable code, disabled HTTPS verification, public caches of authenticated pages or untested database changes. Performance gains are not useful if they expose sessions or make recovery unreliable.
Practical action plan
- Measure representative pages and server resources.
- Resolve failing tasks and environment warnings.
- Enable and verify OPcache.
- Analyse database and storage latency.
- Test Moodle cache stores safely.
- Profile plugins, theme components and course pages.
- Load-test staging, deploy one change and compare the baseline.
Final advice
Optimise the slowest verified layer first. Once response time is healthy, a streamlined theme can improve perceived speed and navigation; compare maintained options at Themes Almond.
Source check: Verified against Moodle’s official performance recommendations, cache usage and cluster guidance.
2 Replies to “How to Speed Up a Slow Moodle Site”