-
Notifications
You must be signed in to change notification settings - Fork 1k
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
RFC: feat(functions): PHP 7.4 preloading #1304
base: main
Are you sure you want to change the base?
Conversation
Here is the summary of changes. You are about to add 1 region tag.
This comment is generated by snippet-bot.
|
I am was receiving the following error when running the deployment:
This is very strange, since To fix this, I deployed with a new function NAME. I believe the reason is the I believe the main fix here is to upgrade the server's version of |
Do we have any data on the benefits? E.g., A/B performance? |
@grayside no benchmarks, no, but we should definitely do some sanity-checking here. In theory, it should provide significant improvements on all requests, as the entire classmap is loaded into memory before the first request. |
Closing since we are not actively tracking this work. Maybe we'll want to come back to this if optimize flag proves optimistic. |
This is frustrating, since a lot of work was done to add this sample which could help the performance of Cloud Functions for a lot of our users. Maybe @grayside could suggest someone that might want to pick this up and add it to our docs? |
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.
Verified that this is deployable via the following:
gcloud functions deploy php-http-function-w-preload --gen2 --runtime=php74 --region=us-central1 --source=. --entry-point=preloadDemo --trigger-http --allow-unauthenticated
WIP for preloading in PHP 7.4 Cloud Functions
This demo suggests the users do the following:
Add the following to
composer.json
Add a
preload.php
file containing the following:Add a
php.ini
containing the following:opcache.preload=preload.php
And that's it! Preloading will work for any/all classes handled by Composer's autoloader