It is a nightmare scenario for any Sri Lankan educator or university administrator. You have prepared your students for weeks, the online exam link goes live, and suddenly, 150 students log in at the exact same time.
Instead of a smooth quiz, the pages take 20 seconds to load. Then, the dreaded white screen appears: "503 Service Unavailable" or "Database Connection Error." Panicked WhatsApp messages flood your phone.
Moodle is an incredibly powerful Learning Management System (LMS), but it is famously resource-hungry. If your Moodle site is crashing during peak exam hours, the problem usually isn't Moodle itself—it is your hosting infrastructure.
Here is a deep dive into why standard web hosting fails under Moodle's weight, and exactly how you can fix it permanently.
1. The "Concurrent User" Problem
Hosting companies often advertise "Unlimited Traffic." This is highly misleading. "Traffic" usually refers to monthly bandwidth, not concurrent users (people actively clicking on the site at the exact same second).
When a user reads a static blog post, the server does very little work. But when a student takes a Moodle quiz, the server has to work incredibly hard:
- It processes the login authentication.
- It generates randomized questions from a question bank.
- It initiates an active timer.
- It constantly writes data to the MySQL database every time a student saves an answer or moves to the next page.
If 100 students do this simultaneously on a cheap shared hosting plan, the server's CPU and RAM max out instantly, causing a total crash.
2. PHP Memory Exhaustion
Moodle runs on PHP. Standard shared hosting plans typically limit your PHP memory limit to 128MB or 256MB to prevent one user from hogging the whole server.
Moodle requires a minimum of 512MB, but for an active exam environment, you realistically need 1024MB (1GB) to 2GB of dedicated PHP memory limit. When your Moodle scripts try to execute an exam generation and hit that 256MB shared limit, the server simply kills the process, resulting in a blank screen for the student.
3. The Lack of Database Caching (OPcache)
Without proper caching, Moodle forces the server to read PHP code from the hard drive, compile it, and execute it every single time a student clicks a button.
Optimized Moodle servers use PHP OPcache and Redis/Memcached. OPcache stores the precompiled script in the server's ultra-fast RAM. This reduces the server load dramatically, allowing it to serve the quiz to hundreds of students simultaneously without breaking a sweat. Most budget shared hosts do not allow advanced Redis caching.
How to Fix Your Moodle Crashes Forever
Step 1: Upgrade to a Managed VPS
If you are hosting more than 30 concurrent students taking quizzes, you must move away from Shared Hosting. You need a Virtual Private Server (VPS).
A VPS gives your academy a dedicated slice of server hardware. If you buy a plan with 4 CPU Cores and 16GB of RAM, those resources belong only to your students. They are never shared with other websites. This guarantees stable exam conditions.
Step 2: Utilize NVMe SSD Storage
Because Moodle relies heavily on database read/writes during quizzes, traditional Hard Drives (HDDs) or even standard SATA SSDs can bottleneck. Ensure your hosting provider uses Enterprise NVMe SSDs, which can process database queries up to 10x faster.
Step 3: Moodle-Specific Tweaks
Even with a good server, you can optimize Moodle internally:
- Limit Questions Per Page: Do not put 50 questions on one page. Pagination (e.g., 5 questions per page) reduces the initial loading strain on the database.
- Disable Chat/Messaging During Exams: Moodle's internal AJAX messaging constantly pings the server in the background. Disable it globally during heavy exam weeks.
- Upgrade PHP: Ensure your server is running PHP 8.1 or higher, which executes code significantly faster than older versions.
Don't Let Bad Hosting Ruin Your Academy's Reputation
Your students expect a flawless online learning experience. Server crashes cause immense stress, invalidate exam timers, and damage your institute's professional image.
At Host Asia, we have engineered specialized Moodle & LMS VPS Hosting specifically for Sri Lankan schools, universities, and private tutors. We provide dedicated AMD EPYC CPU cores, massive RAM allocations, and custom PHP/Database tuning to handle massive concurrent traffic spikes.
Frequently Asked Questions
Moodle Performance Troubleshooting














