E
edzlearn
Products
AI Roleplay (Gelato)
Services
Solutions
Resources
About
Watch DemoBook a Demo
edzlearn

The AI learning OS for teams that need to perform — not just complete a quiz. Author with AI, assess with AI, practise with AI.

Product
  • LMS Platform
  • AI Course Builder
  • AI Roleplay
  • Study with AI
  • Onboarding AI
Services
  • LMS Development
  • Content Development
  • DevOps Support
  • SCORM Analyser
Solutions
  • LMS Use Cases
  • Roleplay Use Cases
  • Corporate & Enterprise
  • Academics
Company
  • About Us
  • Security
  • Blog
  • Case Studies
  • Glossary
  • Contact
AI Roleplay (Gelato)
  • AI Tutor
  • Mock Interview
  • Corporate Experiential Learning
  • Overview
© 2026 EdzLMS · All rights reserved.
PrivacyTermsISO 9001 · ISO 27001
Home/Blog/Moodle

Fastest Web Server for Moodle: Apache vs Nginx vs FrankenPHP (2026)

Nginx, Apache or FrankenPHP for Moodle? What load tests actually show about throughput and memory, why Apache prefork + mod_php caps your ceiling, and the supported setup to use. Spoke 4, the finale of the performance series.

MJ
Mihir Jana
·16 July 2026·8 min read
MOODLE
⚡ Quick answer

For Moodle in 2026, Nginx paired with PHP-FPM is the throughput leader under concurrency and the mainstream recommendation. Apache with the event MPM plus PHP-FPM is a close, fully-supported second. Apache with mod_php (prefork) is the slowest and most memory-hungry option at scale and should be avoided for busy sites. Newer runtimes like FrankenPHP and Nginx Unit look promising in benchmarks but are not officially supported by Moodle, so keep them out of production. In practice the web server matters less than your PHP and database tuning - but the wrong choice (Apache prefork + mod_php) caps your ceiling no matter how well you tune the rest.

Nginx+FPM
the throughput leader for Moodle under concurrency
2 supported
web servers Moodle officially supports: Apache & Nginx
Avoid
Apache mod_php (prefork) - highest memory, lowest ceiling at scale
Not yet
FrankenPHP & Nginx Unit - promising but unsupported for production Moodle

Key takeaways

  • Moodle officially supports Apache and Nginx; both are solid when paired with PHP-FPM.
  • Nginx + PHP-FPM generally holds throughput best under high concurrency and uses memory efficiently.
  • Apache with the event MPM + PHP-FPM (proxy_fcgi) is competitive and fully supported - the key is avoiding prefork + mod_php.
  • Apache prefork + mod_php ties a full PHP interpreter to every connection, so memory balloons and the ceiling drops under load.
  • FrankenPHP and Nginx Unit show strong benchmark numbers but are not officially supported by Moodle - don't run them in production yet.
  • This is Spoke 4, the finale of the Moodle performance series - the web server is the last lever after architecture, tuning and caching.

The final spoke of our Moodle Performance Optimization Guide (2026), after architecture, PHP/DB tuning and caching & CDN.

Does the web server really matter?

Honest answer first: for most Moodle sites the web server is not the biggest lever - OPcache, the database and caching move the needle far more. But the web server sets your concurrency ceiling: how many simultaneous requests you can serve before memory runs out or requests queue. Pick the wrong model and no amount of PHP tuning saves you under a traffic spike (think exam start, when everyone logs in at once). So it's worth getting right once, then forgetting about.

The deciding factor isn't really 'Apache vs Nginx' - it's how PHP is executed. Running PHP as a separate FPM pool (which both Nginx and modern Apache do) is efficient; baking PHP into the web server process with Apache's old mod_php + prefork is what causes the trouble.

The contenders

StackMoodle supportConcurrency & memoryVerdict
Nginx + PHP-FPMSupportedEvent-driven; low memory per connection; excellent under loadBest all-round choice
Apache (event MPM) + PHP-FPMSupportedEfficient event model; PHP runs as FPMGreat, fully supported alternative
Apache (prefork) + mod_phpSupported but discouraged at scaleOne PHP interpreter per connection; heavy memoryAvoid for busy sites
FrankenPHPNot officialModern PHP app server; strong benchmarksPromising - not for production Moodle yet
Nginx UnitNot officialMulti-language app server; good numbersExperimental for Moodle

The pattern is clear: anything running PHP as a dedicated FPM pool (Nginx, or Apache event) performs well; the laggard is the legacy Apache prefork + mod_php combination that still ships as a default on some distros.

What the benchmarks show

Community load tests of Moodle across runtimes - for example the open moodle-runtime-compare project, which drives real Moodle with k6 - consistently point the same way: Nginx + PHP-FPM sustains the highest request throughput as concurrency climbs, with Apache event + PHP-FPM close behind. Apache prefork + mod_php falls off fastest because each connection carries a full PHP interpreter, so RAM is exhausted long before CPU. Newer runtimes like FrankenPHP post impressive raw numbers, but because they aren't officially supported you'd be trading a small speed gain for real compatibility and upgrade risk.

Treat any single benchmark as directional, not gospel - results shift with hardware, PHP version, OPcache and database tuning (see Spoke 2). The safe, evidence-backed default is Nginx + PHP-FPM, and the safe migration if you're on Apache is to move from prefork + mod_php to the event MPM + PHP-FPM without leaving Apache at all.

The recommended setup

A clean, fast Moodle front end on Nginx + PHP-FPM looks like this (pair it with the PHP-FPM pool sizing from Spoke 1):

# /etc/nginx/sites-available/moodle
server {
    listen 443 ssl http2;
    server_name lms.example.com;
    root /var/www/moodle;
    index index.php;

    location / { try_files $uri $uri/ /index.php?$query_string; }

    location ~ [^/]\.php(/|$) {
        fastcgi_split_path_info ^(.+\.php)(/.+)$;
        fastcgi_pass unix:/run/php/php8.3-fpm.sock;
        include fastcgi_params;
        fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
        fastcgi_param PATH_INFO $fastcgi_path_info;
    }
}

If you'd rather stay on Apache, switch the MPM to event and run PHP via FPM instead of mod_php:

# Apache: use event MPM + PHP-FPM (not prefork + mod_php)
a2dismod php8.3 mpm_prefork
a2enmod mpm_event proxy_fcgi setenvif
a2enconf php8.3-fpm
systemctl restart apache2

Either way, enable HTTP/2, keep TLS terminated efficiently, and let your CDN and caching layer serve static assets so the origin web server only handles dynamic PHP.

  1. 1
    Check how PHP is running

    If it's Apache prefork + mod_php, that's your ceiling problem - plan to move to PHP-FPM.

  2. 2
    Default to Nginx + PHP-FPM

    For a new build or a migration, this is the evidence-backed, low-memory, high-throughput choice.

  3. 3
    Or switch Apache to event + FPM

    Staying on Apache is fine - just drop prefork + mod_php for the event MPM with proxy_fcgi.

  4. 4
    Turn on HTTP/2 and offload statics

    Serve CSS/JS/media via CDN so the web server only processes dynamic requests.

  5. 5
    Load-test your real peak

    Simulate an exam-start spike with k6 or similar and confirm throughput holds; don't rely on generic benchmarks.

  6. 6
    Skip unsupported runtimes in prod

    Leave FrankenPHP / Nginx Unit for experiments until Moodle supports them officially.

Apache prefork + mod_php

  • A full PHP interpreter per connection
  • Memory balloons under concurrency
  • Lowest ceiling at exam-time spikes
  • Still a distro default in places
  • Tune all you like - it caps you

Nginx + PHP-FPM (edzlms default)

  • Event-driven, low memory per connection
  • Highest sustained throughput in tests
  • PHP runs as an independent FPM pool
  • HTTP/2 + efficient static handling
  • Scales cleanly with the FPM worker count
ℹ

Not sure what your Moodle is running on?

Many slow Moodle sites are quietly on Apache prefork + mod_php. edzlms runs Moodle on tuned Nginx + PHP-FPM with HTTP/2 and a CDN, benchmarked for your real concurrency - we'll audit your stack and show the gap.

💡

You don't have to leave Apache

If you're on Apache and it 'feels slow', you may only need to switch from prefork + mod_php to the event MPM with PHP-FPM. That single change removes the per-connection PHP memory cost - no platform migration required.

Frequently asked questions

What is the fastest web server for Moodle?

Nginx paired with PHP-FPM generally delivers the highest throughput for Moodle under concurrency while using memory efficiently, which is why it's the mainstream recommendation. Apache with the event MPM plus PHP-FPM is a close, fully-supported alternative.

Is Apache or Nginx better for Moodle?

Both are officially supported and perform well when PHP runs as a separate FPM pool. Nginx + PHP-FPM tends to lead on throughput and memory efficiency. The real mistake is Apache with prefork + mod_php, which caps concurrency; switching Apache to the event MPM + PHP-FPM closes most of the gap.

Why is Apache mod_php (prefork) slow for Moodle?

With prefork + mod_php, every connection carries its own full PHP interpreter, so memory is consumed per connection and the server runs out of RAM under load long before CPU. Running PHP as an FPM pool (with Nginx or Apache event) avoids that.

Can I run Moodle on FrankenPHP or Nginx Unit?

They show strong benchmark numbers, but neither is officially supported by Moodle, so they're not recommended for production. You'd risk compatibility and upgrade issues for a small speed gain. Stick with supported Nginx or Apache + PHP-FPM.

Does the web server matter more than PHP and database tuning?

No - OPcache, the InnoDB buffer pool and caching usually move performance more. But the web server sets your concurrency ceiling, so the wrong model (Apache prefork + mod_php) can cap you no matter how well you tune everything else.

How should I test which is faster for my Moodle?

Run a load test that simulates your real peak - for example an exam start where many users log in at once - using a tool like k6 against your actual content. Generic benchmarks are directional; your hardware, PHP version and tuning change the result.

Get the whole stack right, once

The web server is the last piece of the performance puzzle - and the easiest to get wrong by inheriting a distro default. edzlms runs Moodle on tuned Nginx + PHP-FPM with HTTP/2, Redis caching and a CDN, benchmarked for your real concurrency, so you never hit an avoidable ceiling.

The full series: pillar, architecture, PHP/DB tuning and caching & CDN.

Book a Free Demo

Prefer to pick a slot directly? Grab a time here, or email marketing@edzlms.com.

Written by Mihir Jana, founder of edzlms - connect on LinkedIn.

Tags

Moodle web serverNginxApachePHP-FPMMoodle performanceedzlms

Related articles

Moodle7 min read

Moodle Caching & CDN: Redis, MUC & Faster Media (2026)

Speed up Moodle with caching done right: map Application, Session and Locking caches to Redis via MUC, turn off theme designer mode, minify and cache assets, enable X-Sendfile and put a CDN in front. Spoke 3 of the performance series.

Moodle7 min read

5 Moodle Admin Moves That Save Hours Every Week (2026)

Five set-once Moodle automations that hand busy admins back hours a week - cohort sync enrolment, scheduled reports, course templates, bulk user management and automatic completion reminders, with CLI snippets.

Moodle7 min read

How Much Does Moodle Really Cost? Hosting, Setup & Hidden Fees (2026)

Moodle software is free - running it isn't. The real cost of Moodle in 2026 across hosting, setup, maintenance, plugins and support, the hidden fees that break budgets, and how the delivery models compare.

See EdzLMS in action.

Book a 45-minute demo tailored to your industry.

Book a Free Demo →