-
Notifications
You must be signed in to change notification settings - Fork 27
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
Feature optimize opcache #943
Feature optimize opcache #943
Conversation
In production, PHP files are never checked for modification on the filesystem. They are simply read into the PHP Opcache, and used from cache. (fast) Also, There is less verbose logging in production. This switch allows for easier enabling of features like profiling that may only ever be used in development.
I documented 'Opcache' at https://meta.qualitybox.us/wiki/Opcache |
Regarding |
Well, the only PHP files would theoretically be local extensions, core extensions, or core updates (and a few miscellaneous like ServerPerformance, WikiBlender). I think Apache gets restarted on the 'mediawiki' role....checking.... nope there isn't a handler. OK, so we should have a handler that can stop Apache (or at least put the wiki into read-only with a site notice) and then do the mediawiki role, and then start or reload Apache. That would perhaps require a new setup in HAProxy or Apache that could serve a static file during deploys. |
Taking the site down or substantially limiting it seems like a heavy handed approach. Also I wasn't under the impression that Apache needed to stop during deploy...just that after a file-changing deploy it'd need to be restarted. How hard would it be to detect if anything changed in |
You chose this number based on the number of PHP files in |
|
Rather than restart Apache, I think we could just reset opcache by doing the following:
<?php
if (
! isset( $_SERVER['HTTP_X_FORWARDED_FOR'] ) &&
( $_SERVER['REMOTE_ADDR'] === 'localhost' || $_SERVER['REMOTE_ADDR'] === '127.0.0.1' )
) {
opcache_reset();
}
else {
header('HTTP/1.0 403 Forbidden');
}
This seems less invasive to me than doing an Apache restart which could cause users to lose data. |
I think we could raise it to ~10000 without losing efficiency, and that would be good for almost anyone because I based the number on my QualityBox demo with 101 extensions. |
@freephile I'd like to experiment with this on one of our dev servers a bit. I've changed the branch it pulls into to keep it out of |
@freephile is there an issue with having |
Changes to the php.ini to optimize PHP's Opcache
Introduces new config called 'm_mode' (default 'production').
meza mode (development or production)