-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
ability to use php 7.4 preloading #409
Comments
For what it's worth: documentation on this functionality: https://www.php.net/manual/en/opcache.preloading.php had been published by the end of July 2020: php/doc-en@83c41a8 |
For me (on dokku/herokuish), putting this in
Make sure that
|
@bjornpost thanks for the insight, did you observe any (significant) improvements? |
@holtkamp I'm not sure how and where to measure these improvements, so I wouldn't dare to burn my fingers on that. I'm not noticing big improvements in ttfb on individual requests though. |
@bjornpost maybe you see a drop in response time on something like NewRelic or the Heroku metrics 🤓. Will try to get it working as well and hopefully report back |
@holtkamp did you manage to get it working? |
Did not try yet... Hopefully "this year"... |
Is this something that should work out of the box or does heroku need to do something to support the usage of |
@bjornpost |
After looking in to this, not all ini settings can be set in a .user.ini file or in a custom phpfpm.conf See this here https://www.php.net/manual/en/configuration.file.per-user.php
And you can see on this page https://www.php.net/manual/en/ini.list.php that the setting opcache.preload is PHP_INI_SYSTEM so I believe this setting has to be set another way in heroku. This does not work either: Procfile
phpfpm.conf
Is it is possible to set these settings in the php.ini that is used when php-fpm starts? |
The answer to @jwage's question is... Anyway... what do y'all think about |
Did anyone figure this out in a way that doesn't replace the production ini? Edit: I've been running some experiments and come up with this: #!/usr/bin/env bash
set -e
set -o pipefail
cat .heroku/php/etc/php/php.ini - <<'EOT' > config/php.ini
opcache.preload=/app/config/preload.php
opcache.memory_consumption=256
opcache.max_accelerated_files=20000
EOT
exit 0
{
"scripts": {
"compile": [
"@php bin/console cache:clear --env=prod --no-optional-warmers --no-debug"
".heroku/compile.sh"
]
}
web: vendor/bin/heroku-php-apache2 -C .heroku/apache.conf -i config/php.ini public/ |
I cannot find any information on using the new php 7.4 preloading feature with Heroku. Since we need to input a path, I'm not sure if I can do it manually
For example in Symfony this can normally be enabled with a simple one-liner in the php.ini: https://symfony.com/doc/current/performance.html#use-the-opcache-class-preloading
It's supposed to add about 75% performance. That's quite a lot, so I'd like to use it - and I'm probably not the only one :)
The text was updated successfully, but these errors were encountered: