Skip to content

Comments

feat: Add preload.php script for opcache preloading#52522

Draft
come-nc wants to merge 1 commit intomasterfrom
feat/add-preload-script
Draft

feat: Add preload.php script for opcache preloading#52522
come-nc wants to merge 1 commit intomasterfrom
feat/add-preload-script

Conversation

@come-nc
Copy link
Contributor

@come-nc come-nc commented Apr 29, 2025

Summary

Adds a preload.php script to use with opcache preload feature added in PHP 7.4.

According to my tests so far, this does not help performances, I could not get a measurable improvement.

I’m still pushing this in case me or someone else wants to spend more time investigating on this.

The define trick is ugly, and for some reason autoloading apps was failing. Ideally the script would not call OC::init and only use the autoloader.

Checklist

@come-nc come-nc added enhancement 1. to develop Accepted and waiting to be taken care of php Pull requests that update Php code labels Apr 29, 2025
@come-nc
Copy link
Contributor Author

come-nc commented Apr 29, 2025

Sample php.ini to use this:

opcache.preload=/var/www/html/preload.php
opcache.preload_user=www-data

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

1. to develop Accepted and waiting to be taken care of enhancement performance 🚀 php Pull requests that update Php code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Support Preloading

1 participant