A learning management system has the strangest load profile in enterprise software: nearly nothing in August, a steady hum during term, and a nine-day wall of quiz submissions in exam week when every student is logged in at once. Hosting sized for exam week is idle for eleven months. This post follows a college IT director comparing three ways to host Moodle, including self-hosting on MassiveGRID PaaS, which is built on Virtuozzo Application Platform, formerly Jelastic.

The institution is a further-education college we will call Ashgrove College: 8,000 students, 600 staff, roughly 1,200 concurrent users on a normal weekday and up to 4,000 during exam week. It needs a dozen plugins, including a custom timetable integration, and single sign-on with its identity provider. The Moodle package on the marketplace installs Moodle with a PHP application server and a database in one click.

Three hosting models in one paragraph each

MoodleCloud is Moodle HQ's SaaS, priced by tiers of user count and storage. It is genuinely turnkey, but plugin installation is restricted to what the plan allows, and the higher tiers still cap users and storage. A Moodle Partner hosts and supports Moodle for you with full plugin freedom, priced on an annual contract usually sized for peak load. Self-hosted Moodle on a PaaS gives the college full control of plugins, theme and data, with the operational work on the college's IT team and a bill that follows usage rather than a contract.

Where Ashgrove's requirements land

RequirementMoodleCloudMoodle PartnerSelf-hosted on PaaS
8,000 users, 4,000 concurrent in exam weekTop tiers onlyYes, sized for peakYes, scales for peak
Custom timetable pluginNo custom pluginsYesYes
SAML single sign-onPlan dependentYesYes (auth_saml2 plugin)
Data locationMoodle HQ's regionsPartner's choiceLondon or Frankfurt, chosen by the college
Cost modelFixed tierAnnual contract for peakHourly on actual usage
Who does upgradesMoodle HQPartnerCollege IT, rehearsed on a clone

The custom plugin rules out MoodleCloud. The comparison is therefore between a partner's annual contract and self-hosting, and it comes down to two things: whether the IT team can carry the operations, and what exam week costs under each model.

What Moodle actually needs at 4,000 concurrent users

Moodle is PHP with a database and a shared file store called moodledata. At 4,000 concurrent users during quizzes, the PHP tier needs several application servers behind a load balancer, the database needs headroom for quiz attempt writes, and sessions and Moodle's cache (MUC) should live in Redis so any application server can serve any student. At 1,200 concurrent, one or two application servers suffice. The difference between the two states is what the college pays a partner for all year.

On the platform the Moodle environment has a PHP layer with horizontal auto-scaling triggers, a MariaDB node that scales vertically, a Redis node for sessions and cache, and moodledata on a shared storage container mounted into every PHP node. The triggers add application servers when the layer's average CPU crosses a threshold and remove them when it falls, evaluated every minute. During exam week the layer runs six nodes; on an August afternoon it runs one.

Exam week, costed

A cloudlet is 128 MiB of RAM plus 400 MHz of CPU, billed per hour on what each container actually uses. The IT director models the year in three states.

StateDays per yearTypical cloudlets/hour (all nodes)Cost at $0.003372/cloudlet-hour
Term time200About 90About $1,460
Exam weeks (two per year)18About 320About $465
Holidays147About 30About $355
Year365About $2,280 before discounts, plus storage

The partner quote sized for exam week was several times that annual figure, because a fixed contract has to assume the peak every day. The director's point to the finance committee was not that self-hosting was cheaper per hour; it was that the college would pay for exam week only during exam week.

The operational commitment, honestly

Self-hosting means the college's two-person IT team owns upgrades, plugins and backups. The director listed what the platform takes off that list. Containers on separate hosts with live migration and a 100% uptime SLA mean no server maintenance. Moodle's minor upgrades are a container redeploy with data preserved, rehearsed first on a cloned environment that costs cents for an afternoon. Backups are the Database Backup/Restore add-on nightly plus storage snapshots for moodledata. Load alerts arrive by email. Moodle's cron runs from the platform's cron editor on one node. The remaining work is Moodle administration, which the team was already doing on the previous on-premises server, badly, because that server also needed patching.

The decision

Ashgrove chose self-hosted Moodle on the London region, kept the partner for an annual health check and second-line support at a fraction of the hosting contract, and moved the on-premises server to the recycling schedule. The first exam week on the new platform saw the PHP layer scale from two nodes to seven and back over nine days. The helpdesk logged no Moodle tickets, which the director noted was a first. The second exam week, in January, ran on the same triggers with no changes, and the platform's billing history for the two weeks came in within a few percent of the model in the table above.

Frequently Asked Questions

Does the one-click Moodle package include the load balancer and Redis?

The package installs one PHP application server and one database, with automatic vertical scaling on. Horizontal scaling adds an NGINX load balancer automatically the first time you scale the PHP layer, and Redis and a shared storage node are added from the topology wizard. Moodle's Redis cache store and session handler are then configured in config.php.

Where does moodledata live when there are several PHP nodes?

On a shared storage container mounted at the moodledata path on every PHP node over NFS, so uploads and course files are visible to all of them. The platform's mount points UI configures this, and new nodes added by scaling inherit the mount.

Can we run a separate Moodle for the college's commercial training arm?

Yes. Clone the environment, or install the package again, and place each in its own environment group. Each Moodle has its own database, plugins and billing, and staff can be given access to one but not the other through the account's collaboration roles.

Pay for exam week during exam week

The Moodle package installs Moodle with PHP and a database in one click on MassiveGRID PaaS, scales the PHP layer for peaks and bills per cloudlet-hour. London, Frankfurt, New York or Singapore. Free 14-day trial, no credit card.

Moodle on MassiveGRID PaaS

Further Reading