Skip to content

Disable PHP OPcache JIT by default - #1653

Merged
retlehs merged 1 commit into
masterfrom
disable-jit-by-default
Mar 18, 2026
Merged

retlehs merged 1 commit into
masterfrom
disable-jit-by-default

Conversation

@retlehs

@retlehs retlehs commented Mar 18, 2026

Copy link
Copy Markdown
Member

Summary

  • Disable JIT by default (php_opcache_jit: 'disable', php_opcache_jit_buffer_size: 0)
  • Consolidate JIT directives into 10-opcache.ini.j2 (previously split across 10-opcache.ini.j2 and php-fpm.ini.j2)

Context

PHP 8.3's JIT tracing mode has known memory corruption bugs that cause recurring PHP-FPM worker crashes. The crash signature is a consistent ~4GB allocation attempt (0x100040000), which is a JIT corruption artifact — not real application memory demand.

Reported here: https://discourse.roots.io/t/php-8-3-jit-tracing-recurring-crash-at-theme-php-325-4gb-allocation/30241

Since Trellis defaults to PHP 8.3 with JIT tracing enabled, all sites on default configuration carry this risk. WordPress workloads are overwhelmingly I/O-bound and see negligible real-world performance benefit from JIT, making it a poor tradeoff.

OPcache bytecode caching remains fully enabled and unaffected.

Re-enabling JIT

Users who want JIT can opt in via group_vars:

php_opcache_jit: 'tracing'
php_opcache_jit_buffer_size: 256M

🤖 Generated with Claude Code

JIT tracing mode in PHP 8.3 has known memory corruption bugs that can
cause recurring PHP-FPM crashes with ~4GB allocation attempts. WordPress
workloads are I/O-bound and see negligible benefit from JIT, making the
risk/reward unfavorable.

JIT can be re-enabled via group_vars by setting php_opcache_jit and
php_opcache_jit_buffer_size.

Also consolidates JIT directives into 10-opcache.ini.j2 instead of
splitting them across two config files.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@retlehs retlehs self-assigned this Mar 18, 2026

@swalkinshaw swalkinshaw left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unfortunate but makes sense for now

@retlehs
retlehs merged commit 8f49e10 into master Mar 18, 2026
2 checks passed
@retlehs
retlehs deleted the disable-jit-by-default branch March 18, 2026 16:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants