Skip to main content
MoodleLMSRAM
MoodleLMSRAM Partner Disclosure: Outbound /go/ links marked rel="sponsored" may earn a referral commission at zero extra cost (Partner Disclosure).
Stack Matrix Hub (10)

Moodle Cron CLI & Parallel Adhoc Task Worker Memory

Isolate scheduled cron.php and adhoc_task.php memory spikes from interactive exam PHP-FPM pools so PDF annotation and grading never starve students.

task_adhoc_concurrency=3 · Separate CLI memory_limit=512M · 60s systemd timer

Moodle Cron CLI & Parallel Adhoc Task Worker Memory
Telemetry verified 2026-10-25 by ExamLoad Systems.

Why Background Adhoc Tasks Spike Memory During Exam Windows

Moodle processes forum digests, assignment PDF conversions, quiz regrades, and .mbz automated course backups through CLI adhoc task runners. If unconstrained, 10 parallel Ghostscript/PHP CLI tasks can consume 3+ GB RAM mid-exam.

Capping task_adhoc_concurrency During Peak Hours

Set $CFG->task_adhoc_concurrency = 2 or 3 on 8-16 GB servers, keep $CFG->task_scheduled_concurrency = 2, and move heavy automated course backups outside live exam hours.

Measured Thresholds & Configuration

Host RAM Tiertask_scheduled_concurrencytask_adhoc_concurrencyCLI Memory Reserve
3 - 4 GB Turbo11256 - 384 MB
8 GB Cloud VPS22512 - 768 MB
16 - 32 GB VDS2 - 33 - 41,024 - 1,536 MB
task_adhoc_concurrency=3 · Separate CLI memory_limit=512M · 60s systemd timer Launch ChemiCloud ($4.49/mo)UltaHost VDS ($41.50/mo)