-
Notifications
You must be signed in to change notification settings - Fork 301
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
Add clear the cache of APCu and Opcache #385
Conversation
What does this actually fix? The OP of the issue doesn't actually talk about what their problem is. How can I recreate a problem that this code change fixes? |
Hi @taylorotwell This pull req fixes it by adding the |
When cache extensions such as |
@kevincobain2000 |
Thanks @sy-records
One solution I could think of is to have a singleton or |
It won't overwrite is right, it's reload, not restart |
Why clear opCache when each worker starts? This should be decided by the user (via |
@@ -37,6 +37,7 @@ public function __invoke($server, int $workerId) | |||
|
|||
$this->dispatchServerTickTaskEverySecond($server); | |||
$this->streamRequestsToConsole($server); | |||
$this->clearCache(); |
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.
每个 worker 在 start 的时候都跑一遍?
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.
是这个意思的, 你的 --max-requests
设置的越大影响越小
Each worker starts upon 1) reloading application or 2) when
Therefore, yes |
@kevincobain2000 |
I am not sure if I get what you mean by
You mean control enable/disable of opcache or flush opcache? For the apps that have opcache enabled, flushing opcache cannot be controlled by user (in a separate cli), unless the Octane app is restarted. Unlike fpm, where fpm:reload flushes opcache, cli cannot flush opcache. Therefore, in the case of octane:reload (...a new deployment), cache codes need to be flushed. |
I understand what you mean. We now use docker deployment. When building, the opcode of commonly used php files will be cached first, and set Clear the cache when octane starts, such as this Clearing the cache when the worker starts can be used for hot updates, such as this I think clearing the cache is an option, or even the default, but it is not necessary. |
@hughcube |
Fix #384
If PHP has APCu/OPcache enabled, reloads will be affected when reloading, so you need to clear the cache