Stack Matrix Hub (9)
OPcache Preloading & Symfony 7.1 Container Speed for Sylius 2.x
Eliminate PHP-FPM cold-start overhead by preloading config/preload.php and sizing opcache.memory_consumption to 256-384 MB.
256-384 MB OPcache · 32-64 MB strings · max_accelerated_files=32531
Why Default 128 MB OPcache Evicts Sylius Vendor Classes
A full Sylius 2.x vendor tree with API Platform, Doctrine, Twig, and Messenger exceeds 16,000 PHP files. PHP default opcache.memory_consumption=128 and max_accelerated_files=10000 force constant script eviction and CPU spikes.
Enabling config/preload.php Safely in Production
Set opcache.memory_consumption=320, opcache.interned_strings_buffer=48, opcache.max_accelerated_files=32531, opcache.validate_timestamps=0, and point opcache.preload to var/cache/prod/App_KernelProdContainer.preload.php with atomic blue-green deploys.
Measured Thresholds & Configuration
| Sylius 2.x Stack Tier | opcache.memory_consumption | interned_strings_buffer | max_accelerated_files |
|---|---|---|---|
| 10k SKU Classic FPM | 256 MB | 32 MB | 20000 |
| 50k SKU FrankenPHP | 320 MB | 48 MB | 32531 |
| 100k+ B2B + Bundles | 384 MB | 64 MB | 65407 |