This week in caching: an OPcache tuning pass that actually moves p99
Four dials most people leave at defaults. Gold for anyone running PHP-FPM at scale.
— Size to your codebase — set opcache.memory_consumption to ~256MB for large apps; watch opcache_get_status() for cache_full=true, the silent killer.
— Raise the file ceiling — opcache.max_accelerated_files defaults to 10k; Laravel or big WP easily exceed that, evicting hot files. Bump to 32531 (next prime up).
— Freeze validation in prod — opcache.validate_timestamps=0 stops a stat() on every request, but now you MUST reset OPcache on deploy or serve stale code.
— Add the JIT carefully — opcache.jit=tracing helps CPU-bound work, often nothing for I/O-bound web apps; benchmark before celebrating.
Credit to Brent Roose's PHP-FPM tuning writeups for the validation-timestamps trap.
Bookmark: the official opcache_get_status() output — read it before and after every change.
Cache Catch
@CacheCatch
This week in caching: an OPcache tuning pass that actually moves p99
Этот пост опубликован в Telegram-канале Cache Catch. Подписаться можно по ссылке: @CacheCatch.