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)

OPcache Sizing for Moodle 4.x Codebase & Interned Strings

Prevent OPcache full-cache eviction storms across Moodle 4.x 15,000+ PHP files by sizing opcache.memory_consumption and interned_strings_buffer.

256-384 MB OPcache · 32-64 MB interned_strings · max_accelerated_files=32531

OPcache Sizing for Moodle 4.x Codebase & Interned Strings
Telemetry verified 2026-10-25 by ExamLoad Systems.

Counting Moodle 4.x Core + Plugin PHP Files

A clean Moodle 4.4 tree exceeds 14,000 PHP files, and adding H5P, BigBlueButton, attendance, and custom themes pushes total compiled scripts past 22,000 files. PHP default max_accelerated_files=10000 causes silent cache misses and CPU spikes.

Fixing Interned Strings Exhaustion Under PHP 8.2/8.3

Leaving opcache.interned_strings_buffer at 8 MB triggers full OPcache resets every few hours on active Moodle sites. Set opcache.memory_consumption=320, opcache.interned_strings_buffer=48, and opcache.max_accelerated_files=32531 inside php-fpm.conf.

Measured Thresholds & Configuration

Moodle Codebase Profilememory_consumptioninterned_strings_buffermax_accelerated_files
Moodle 4.3 Core256 MB32 MB20000
Moodle 4.4/4.5 Mixed320 MB48 MB32531
Moodle 4.5 + Heavy Plugins384 MB64 MB65407
256-384 MB OPcache · 32-64 MB interned_strings · max_accelerated_files=32531 Launch ChemiCloud ($4.49/mo)UltaHost VDS ($41.50/mo)