Who has enabled PHP JIT? Have you seen benefits with XenForo code or others code bases like Wordpress?

bzcomputers

Well-known member
PHP JIT was introduced in PHP 8.0 but there really isn't much out there on performance benefits above OPcache itself other than few benchmark tests over the last 4 years showing a minimal increase in performance when paired with OPcache.

Four years later and JIT is on the cusp of an upgrade in PHP 8.4 with a new JIT implementation based on IR Framework.

So, I can only assume with its' continued development it must be benefiting a significant group of PHP users and with the new PHP 8.4 implementation it appears that those benefits will only increase.

That being said, I still question "Why is it not enabled by default?".

Just looking for any insight from those who have tried running, or are currently running, PHP JIT on their servers. Benefits seen, any problems encountered, etc.
 
PHP JIT was introduced in PHP 8.0 but there really isn't much out there on performance benefits above OPcache itself other than few benchmark tests over the last 4 years showing a minimal increase in performance when paired with OPcache.

Four years later and JIT is on the cusp of an upgrade in PHP 8.4 with a new JIT implementation based on IR Framework.

So, I can only assume with its' continued development it must be benefiting a significant group of PHP users and with the new PHP 8.4 implementation it appears that those benefits will only increase.

That being said, I still question "Why is it not enabled by default?".

Just looking for any insight from those who have tried running, or are currently running, PHP JIT on their servers. Benefits seen, any problems encountered, etc.
I'm using it on very big board when it was running on PHP 8.0 and still using it on PHP 8.2. So far in terms of performance, I think that would really be very minimal. Though site was able to handle quite a load. Didn't faced any errors but I never really measured the impact on performance.
 
I bet @eva2000 has a ton of insight on this. :D
Haven't played with PHP JIT in a while - old PHP Profile Guided Optimization and PHP JIT benchmarks comparing Centmin Mod PHP-FPM (with optional PGO or PGO+JIT) vs Remi PHP-FPM https://community.centminmod.com/threads/php-8-0-0-ga-stable-release.20739/#post-87299

PGO
technique called Profile-Guided Optimization or PGO. The basic idea is as follows: When any program is compiled, the compiler uses some heuristics to determine the most likely path your program will take through the code, and optimizes the code using those assumptions.

PGO lets you train the compiler to produce a more optimized result. It does this by first compiling the code with instrumentation, then run the instrumented code which creates a profile. The final step is to recompile the program, using the profile to fine-tune the optimizations.

Centmin Mod PHP-FPM built with optional PGO enabled can boost PHP performance one major version so PHP 8.0 with PGO gets PHP 8.1 level performance, PHP 8.2 with PGO will have PHP 8.3 level performance and so on :)

So even Centmin Mod PHP 7.4 with PGO enabled (and without JIT enabled) already achieves REMI PHP 8.0 performance levels. Below chart shows Centmin Mod PHP 8.0 with only PGO enabled or even without PGO was as fast as REMI PHP 8.0 with JIT enabled. So it's not what you use but how you use it that matters ;)

Even tried seeing if any Xenforo folks would help with coding for Xenforo specific PGO training https://xenforo.com/community/threa...foro-php-performance-via-pgo-training.156939/ though my Centmin Mod LEMP stack does have support to optionally feed PHP scripts to PHP-FPM for PGO training at compile time it isn't same as specific PGO training.

1715893178800.webp

very old Wordpress benchmarks with Wordpress PHP code fed into Centmin Mod's PHP-FPM PGO training routines for PGO tuned (generic training) vs WP PGO Trained (Wordpress specific PGO training) https://community.centminmod.com/posts/69010/

1715893643906.webp
 
Last edited:
Just looking for any insight from those who have tried running, or are currently running, PHP JIT on their servers. Benefits seen, any problems encountered, etc.
Been active for 2+ years from 8.0 (now using 8.2) and have not had a single issue.
Just make sure jit cache size is large enough, a full cache can degrade performance. I use 96M jit cache config for my site.
 
Well, it's been a week since I enabled JIT and I can say I haven't seen any changes. I originally set the opcache.jit_buffer_size to "512M", but after a few days the used JIT buffer was still under 1M so I reduced the opcache.jit_buffer_size to "128M".

I am interested in seeing what JIT used buffer sizes others are seeing. Here are a couple free web dashboards for PHP caching that will quickly give you JIT details:

Opcache GUI - Includes details for Opcache / JIT

phpCacheAdmin - Includes details for OPcache / JIT, Redis & Memcached
 
Back
Top Bottom