PHP OPcache and JIT: Complete Tuning
OPcache caches compiled PHP bytecode, eliminating recompilation on every request. JIT (PHP 8.0+) compiles bytecode to machine code — up to 3x speedup for CPU-intensive tasks.
Base OPcache Configuration
[opcache]
opcache.enable=1
opcache.memory_consumption=256
opcache.interned_strings_buffer=16
opcache.max_accelerated_files=20000
opcache.validate_timestamps=0
opcache.save_comments=1JIT Configuration (PHP 8.0+)
opcache.jit_buffer_size=128M
opcache.jit=tracingNote: JIT doesn't help I/O-bound apps (WordPress, CRUD). It shines for math-heavy code, image processing, and ML tasks.