Case Study
Overnight, a customer’s main WordPress homepages went from well under a second to 1.5 to 1.7 seconds. CPU, memory and disk all looked healthy. The PHP code cache was full and frozen with other sites’ code, so the sites that mattered most were compiled from scratch on every request.
October 2026 · 3 min read
SECTOR
Multi-site web business, managed hosting
SCALE
47 websites on one cPanel server, 41 PHP-FPM pools
PLATFORM
AlmaLinux 9, cPanel/WHM, Apache, PHP 8.4 and 8.2 FPM, MariaDB
ENGAGEMENT
Performance incident, managed support
PHP 8.4 cache hit rate a day later, up from 66%
Priority homepages from the server, down from 1.1 to 1.5 s
Sites returning the same responses after every change
Scroll the diagram sideways to see all of it →
Same server, same sites. Before the fix the cache had no room left and the customer’s busiest sites were not in it at all. After, every site fits with room to spare.
Slow pages on a server that looked idle. The customer reported their main homepages at 1.5 to 1.7 seconds, against 0.6 to 0.85 seconds the morning before, the first morning after the PHP 8.4 cache was raised from 384 to 512 MB. Yet CPU use was lower than the day before, load sat between 0.5 and 1.5, disk wait was about 1 ms and nothing had run out of memory. Measured on the server itself, a static file came back in 16 to 26 ms while the homepages took 1.1 to 1.5 seconds, so the time was being spent inside PHP.
Look at what is in the cache, not how big it is. We placed a small read-only probe in a site for a few seconds to read OPcache’s own status, then removed it. The 512 MB cache was 100% used with 0% wasted, cache_full=true, 16,834 scripts and a 66% hit rate. Only 8 sites had code in it. The three sites the customer cared about most had 0 of their 8 key WordPress files cached.
A bigger cache that is full is no better than a small one. What matters is whether it has room left.
A full cache freezes instead of making room. OPcache does not evict old code to make space. It only resets itself when its wasted memory passes opcache.max_wasted_percentage, and with 0% wasted that never happened. Each PHP reload started a new race to fill it, and there had been 5 reloads in about 24 hours. A fully cached WordPress site took 25 to 90 MB, so 35 sites on PHP 8.4 needed roughly 1.5 to 2.5 GB. A first interim fix (768 MB plus warming the priority sites) brought them to 0.34 to 0.42 s, until an automatic control-panel restart at 04:07 reloaded PHP and they were back above 1.2 s by morning. Warming the cache could not fix a cache that was too small.
Main homepages slowed from under 0.85 s to 1.5 to 1.7 s, with CPU, memory and disk all looking healthy.
Ruled out the server, proved the time was in PHP, then read OPcache from inside: full, frozen, priority sites not cached.
Cache sized for every site: 99.4% hit rate, priority homepages about 0.4 s, all 47 sites unchanged.
php-fpm -t before every reload, the priority sites warmed straight after, and all 47 sites checked against their previous responsescache_full=false and every priority site cached, and a repeatable 24-hour report script now tracks cache, memory and response timesEvery site fits, with room to spare. Five minutes after the change the PHP 8.4 cache held 39,005 scripts from 15 sites in 1,182 of 2,048 MB, with an 89% hit rate. A day later it was at 99.4%. The priority homepages answered in 0.36 to 0.42 seconds from the server, and all 47 sites returned exactly the same responses as before. The next night’s kernel security reboot came back cleanly, with the database shut down first and no crash recovery. We also raised the Apache and per-site PHP worker limits for the busiest sites; their effect on the automatic restarts had not yet been measured when this was written. The before and after timings were taken on different days, both from the server.
We check what is actually cached, size it for the whole server, and prove the result with measurements.