-
Notifications
You must be signed in to change notification settings - Fork 7.9k
Avoid JIT warning with opcache.jit_buffer_size=0 #12460
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
Conversation
zend_accel_error(ACCEL_LOG_WARNING, "Could not enable JIT!"); | ||
/* The JIT is implicitly disabled with opcache.jit_buffer_size=0, so we don't want to | ||
* emit a warning here. */ | ||
if (JIT_G(buffer_size) != 0) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To be entirely honest, I'm not a huge fan of how JIT is disabled by default using the opcache.jit_buffer_size=0
default, instead of opcache.jit=0
.
Do you think it would be OK to change the defaults of opcache.jit
to 0
, and opcache.jit_buffer_size
to a sane default like 16m
at least on master (I'd really love to make the same change on PHP-8.1 though...)?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree that the INI values are sub-optimal. However, changing them in 8.1 would mean anybody who enabled JIT using jit_buffer_size
without also setting jit
would implicitly disable it. This could be changed for master, but should be discussed on the ML as it is a breaking change.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is an RFC required, or just a simple email to discuss it OK?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@danog Depends on whether there are any concerns. When there are concerns it's better to be safe and create a short RFC. Simple RFCs don't need to be long.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@iluuu1994 Sent a discussion email + a karma request :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
By the way, what about instead of completely removing the error, it simply indicated that JIT wasn't enabled because the buffer size is 0?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think the default configuration should emit a warning. It doesn't really, because log_verbosity_level
needs to be increased. That's some INI weirdness by itself.
e996a58
to
95dfeba
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this is a right solution for the old versions.
@danog Changing defaults in master may make sense, but note that now JIT may be enabled but switched off on start-up and then switched on only for specific requests.
/cc @danog