-
Notifications
You must be signed in to change notification settings - Fork 2.2k
Update docs for PHP Opcache use #1717
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
Update docs for PHP Opcache use #1717
Conversation
jandom
commented
May 14, 2020
- otherwise massive perf penalty
- tested against bare metal EC2
- otherwise massive perf penalty - tested against bare metal EC2
This reverts commit c6d700e.
Thanks for the contribution! In reading this, it feels like we're spending a lot of time duplicating common PHP documentation instead of something that's actually Docker-specific. Perhaps we could instead leave this as a very short hint somewhere and point to the official upstream documentation instead? |
Oh hi, wow, thanks for having a look so quickly! Absolutely, happy to follow your lead on this – the example is very verbose – just let me know how to best present it as a hit? Should I scrap the example and replace it with some documentation links? Just to set the context for how this came about. I moved a large-ish production workload from "bare-metal" PHP ElasticBeanstalk to a multicontainer Docker ElasticBeanstalk and saw a pretty big performance drop (requests would take 0.6s rather than expected 0.3s). Then went that rabbit hole and solved my problem, so wanted to spare people some time ("no, it's not the instance type being too small, not it's not an esoteric symfony configuration") |
hi there @tianon – i've truncated the contribution a bit, pointing to some useful blogs instead of including a verbose opcache example, let me know if that's closer to what you wanted? |
Frankly, I was expecting something even more terse, because IMO
In many production environments, it is also recommended to (build and) enable the PHP core OPcache extension for performance. See [the upstream OPcache documentation](https://www.php.net/manual/en/book.opcache.php) for more details. |
Perfect, updated the wording to match what you said – it's now just a paragraph below the configuration section. Should be ready to go 🤞 |
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.
Thanks for the contribution and for hanging with me while we worked this out 👍
@tianon no, thank you for the review – this doc will hopefully save people a ton of time (it would have saved me) because managed platforms (usually) ship with the extension auto-enabled |
@@ -168,7 +168,6 @@ FROM %%IMAGE%%:7.4-fpm-alpine | |||
|
|||
# Use the default production configuration | |||
RUN mv "$PHP_INI_DIR/php.ini-production" "$PHP_INI_DIR/php.ini" | |||
|
|||
# Override with custom opcache settings | |||
COPY config/opcache.ini $PHP_INI_DIR/conf.d/ |
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.
@yosifkit Why was this removed?
The conf.d
-directory is a custom scan-dir, so it is not duplicating common PHP documentation.
https://github.com/docker-library/php/blob/master/7.4/alpine3.12/fpm/Dockerfile#L125
Without this info it is kind of hard to know were to put custom config files, that's why the info was there.
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.
See a few lines up:
The default config can be customized by copying configuration files into the
$PHP_INI_DIR/conf.d/
directory.
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.
Thanks for the hint! (I must be blind 🤦♂️)