Performance and OPcache

Performance, OPcache and PHP-FPM

Speeding up PHP means removing repeated work (compiling the same files, rebuilding the same data), holding less memory per worker, and running the right number of workers for the traffic: OPcache, then memory habits and data caches, then the PHP-FPM pool.

Every number here was measured on one machine, an Ubuntu 26.04 225 WSL2 6 guest with 36 logical CPUs and 64 GB of RAM, running PHP 8.5.4 under PHP-FPM behind Apache 2.4.66 129 with the event MPM and proxy_fcgi (PHP-FPM via proxy_fcgi). The realistic workload is the welcome page of a fresh Laravel 13 2,157 skeleton (Laravel): 496 PHP files per request, with sessions in memory. Your absolute figures will differ; the ratios carry over.

Subsections