Diagnose PHP JIT Processes That Use 100% CPU

When only some PHP-FPM workers pin a CPU after JIT is enabled, first compare the same workload with JIT disabled but OPcache still active. This separates a JIT problem from an application loop, slow extension, or overloaded upstream service.

Last updated: November 8, 2026.

; Temporary diagnostic configuration
opcache.enable=1
opcache.jit=disable
opcache.jit_buffer_size=64M

; Restart PHP-FPM after changing the loaded ini file.
; Then verify the effective values with phpinfo() or php -i.

On PHP 8.4 and later, opcache.jit=disable is the explicit switch. A nonzero JIT buffer does not enable JIT by itself. Restart the correct FPM service or container and verify the web SAPI, not only the CLI configuration.

Confirm the JIT comparison is valid

The PHP OPcache configuration reference documents disable, off, tracing, and function modes. It also explains that the JIT buffer belongs to OPcache shared memory. Record PHP version, SAPI, loaded INI path, JIT mode, buffer size, preload setting, and enabled extensions before testing.

Replay the same request volume against identical containers. If high CPU disappears only with JIT disabled, keep it disabled while you reduce the reproducer. JIT is an optimization, not a correctness requirement, and the PHP 8.4 migration guide confirms it is disabled by default.

Capture the busy request before restarting

Use process monitoring to identify the hot worker and capture a stack sample with the operating system profiler available in your environment. Correlate the process ID with PHP-FPM access logs, slow logs, request identifiers, and deployment time. Do not infer the offending line from the timeout message alone.

Reduce the request to a small script, then test the current supported PHP patch release with third-party extensions and preloading disabled one at a time. If the behavior is reproducible in supported PHP, preserve the configuration and stack trace for a bug report. Keep a restart limit and health check so one worker cannot repeatedly consume the host.

See execution-time troubleshooting, PHP error handling, and debugging with Xdebug.

Related Web Cheat Sheet guides

Sergey Kornilov

Sergey Kornilov