Concurrent Quiz PHP-FPM pm.max_children Capacity Math
Translate simultaneous exam takers and quiz submit clicks into exact pm.max_children counts using 105-162 MB per Moodle 4.x PHP worker.
105-162 MB/worker · ~5:1 student-to-worker peak · pm.max_requests=500
Why Concurrent Quiz Starts Trigger 5x Normal PHP Concurrency
During passive video browsing, 200 logged-in learners rarely hold more than 8 to 12 PHP processes busy simultaneously. When a timed exam opens at 09:00:00, all 200 browsers request mod/quiz/startattempt.php and question assets inside a 10-second burst, driving 35 to 48 parallel PHP-FPM executions.
Sizing pm.max_children Without Exhausting MariaDB RAM
Measure actual RSS with ps_mem or smem after loading question/edit.php and quiz attempts. At 128 MB average RSS per worker on Moodle 4.4, capping pm.max_children at 40 reserves 5.0 GB for PHP-FPM while leaving 2.5 GB for InnoDB and Redis on an 8 GB host.
Measured Thresholds & Configuration
| Concurrent Exam Takers | Peak Active PHP Workers | PHP-FPM Pool RSS (128 MB) | Minimum Host RAM |
|---|---|---|---|
| 50 Students | 10 - 14 pm.max_children | 1.3 - 1.8 GB | 3 - 4 GB (ChemiCloud Turbo) |
| 200 Students | 36 - 44 pm.max_children | 4.6 - 5.6 GB | 8 GB (ChemiCloud VPS 1) |
| 500 Students | 88 - 104 pm.max_children | 11.2 - 13.3 GB | 16 GB (UltaHost VDS-2) |