Skip to content

feat: log when an opcache restart is done - #2844

Draft
nicolas-grekas wants to merge 2 commits into
php:mainfrom
nicolas-grekas:opcache-restart-done
Draft

nicolas-grekas wants to merge 2 commits into
php:mainfrom
nicolas-grekas:opcache-restart-done

Conversation

@nicolas-grekas

Copy link
Copy Markdown
Contributor

Stacked on #2843, review the last commit.

php/php-src#23828 adds a hook that opcache calls once a restart is done. On PHP 8.7, FrankenPHP now logs it with how long caching was off:

INFO opcache restart done, caching resumes reason=hash pending=393ms

The same signal wakes up the worker scripts that started while the restart was pending. They start again right away instead of after their next request.

Draft until php/php-src#23828 is merged. The version check assumes it's merged in 8.7.

A worker uses opcache's shared memory for as long as its script runs. A
restart of that memory reuses memory the worker still references. Once
opcache waits for the threads of the process (php/php-src#24276), the restart
never runs while workers are alive.
With php/php-src#23828, opcache calls a hook once a restart is done. Log it
with how long caching was off. The worker scripts that started while the
restart was pending start again right away, instead of after their next
request.

This branch has not been deployed

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant