-
-
Notifications
You must be signed in to change notification settings - Fork 606
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add JIT options #1505
Add JIT options #1505
Conversation
🤔 interesting! That's a good question.. but I'm tempted to do nothing since that could also apply to lots of other configuration files that Trellis has never handled in any special way? What do you think about making |
Yes, a release or changelog note about this file now being managed by Ansible should suffice. When merging in new changes from upstream Trellis and following good/best practices one should check and notice this anyway.
There appears to be no downside to enabling JIT, and one can always disable it via an ansible option |
Just testing this out and it's working fine. But if we want it enabled by default, don't we need |
@swalkinshaw: Indeed, |
I realized that this wasn't conditional for PHP >=8 so I was curious what would happen on 7.4 .... and the answer is thankfully nothing? PHP just ignores the jit variables seemingly since I get no errors or warnings and PHP is working as expected. |
Thanks @strarsis 🎉 |
This PR adds PHP
8
OPcacheJIT
related options minimally required for (optionally) enablingJIT
.The Ubuntu default configuration file
/etc/php/<php_version>/fpm/conf.d/10-opcache.ini
disables JIT (by explicitly setting it tooff
), hence the configuration file is controlled by a template to allow enabling or disabling JIT.The default value for
php_opcache_jit
(corresponding ansible variable foropcache.jit
) isOff
tracing
(which enables JIT by default). (Note: Other option values available:disable
(likeoff
, but prevents changing option on PHP runtime;on
(enables JIT; aliases totracing
);tracing
(currently the same ason
);function
.)In order to enable JIT, the value
opcache.jit_buffer_size
(corresponding ansible variablephp_opcache_jit_buffer_size
) option also has to be set to something different than its default0
, as0
also disables JIT.0
is used as the default forphp_opcache_jit_buffer_size
. (Note: A reasonable, often proposed size foropcache.jit_buffer_size
would be256M
.)🤔 when someone manually edited that
/etc/php/<php_version>/fpm/conf.d/10-opcache.ini
file, it would be overwritten by Ansible of course, as it is now managed by Ansible. Add warning, skip when edited or something else in that case?