FrankenPHP Worker Mode vs Classic PHP-FPM 8.3 for Sylius 2.x
Trade 94 MB cold PHP-FPM workers for 138 MB persistent FrankenPHP threads that keep the Symfony DI container booted in RAM.
138 MB/thread · 2.5-3.0x req/s density · Zero kernel reboot tax
Eliminating Symfony Container Boot Overhead on Every Request
Classic PHP-FPM rebuilds Symfony service definitions, Doctrine metadata mappings, and Twig environment state on every request unless heavily masked by OPcache preload. FrankenPHP worker mode boots the Sylius 2.x kernel once per Go/PHP thread and serves thousands of requests before graceful recycling.
Calculating Thread Count vs Worker RSS Drift
Because persistent threads retain compiled Twig templates, serializer metadata, and Doctrine proxies in heap, budget 138 to 176 MB per FrankenPHP thread versus 94 MB per classic PHP-FPM child. Configure max_requests inside Caddyfile worker directives to bound long-term heap growth.
Measured Thresholds & Configuration
| Runtime Mode | Memory per Worker | Throughput per Worker | 100 req/s Pool Size |
|---|---|---|---|
| PHP-FPM 8.3 (OPcache Preload) | 94 MB average RSS | 4.5 req/s sustained | 23 pm.max_children (~2.1 GB) |
| FrankenPHP Worker Mode | 138 MB persistent RSS | 12.5 req/s sustained | 8 threads (~1.1 GB) |
| FrankenPHP + B2B API Platform | 176 MB persistent RSS | 9.0 req/s sustained | 12 threads (~2.1 GB) |