Stack Matrix Hub (10)
MariaDB InnoDB Buffer Pool & Quiz Attempt Write-Burst Tuning
Prevent mdl_question_attempt_steps and mdl_grade_grades write stalls during final-minute exam submissions with proper InnoDB buffer and log sizing.
innodb_buffer_pool_size 25-35% RAM · innodb_log_file_size=512M · trx_commit=2
Why Exam Submissions Hammer Question Attempt Tables
Submitting a 40-question quiz writes dozens of rows across mdl_question_attempts, mdl_question_attempt_steps, mdl_quiz_attempts, and mdl_grade_grades inside short transactions. Undersized redo logs force synchronous checkpoint flushes mid-exam.
Balancing InnoDB Memory Against PHP-FPM on Single-Node Hosts
On a single-server 8 GB VPS, allocate 2.0 to 2.5 GB to innodb_buffer_pool_size rather than the generic 70% rule, because PHP-FPM workers claim 4.5+ GB during spikes. On split DB servers, raise InnoDB to 60-70% of dedicated database RAM.
Measured Thresholds & Configuration
| Deployment Tier | innodb_buffer_pool_size | innodb_log_file_size | innodb_flush_log_at_trx_commit |
|---|---|---|---|
| 8 GB Single-Node VPS | 2,048 MB (2 GB) | 512 MB | 2 (1s OS flush) |
| 16 GB Dedicated VDS | 4,608 MB (4.5 GB) | 1,024 MB | 2 or 1 on NVMe |
| 16 GB Split DB Node | 10,240 MB (10 GB) | 2,048 MB | 1 (full ACID NVMe) |