Thanks @wadestriebel @invisnet @james
First I’ll say that configuring opcache is new to me, but I have invested some time reading and experimenting.
Value in seconds.
Obviously in a custom development environment it’s probably at 0 and all is good.
Default vs commonly set values appear to range:
Shared hosting environments will presumably vary.
I used a replica and tried a limited number of runs at 2, 5, 10, 15, 60. Based on limited number of runs:
-
60 was always problematic
-
It worked once at 15 but failed once at 10, so obviously timing dependent.
-
2 was OK (but again limited runs)
Unfortunately it appears this could cause server load issues and upset hosts:
After some experimenting I could reduce the problem of the loads to just this: opcache_reset()
Once I perform this call (independently of any prior or later deployment steps, this happens also in isolation when I just call this endpoint) there’s a chance the the system load suddenly spikes.
If that happens and the load is “too high” (I would say from experience > 200 or so), the system becomes unresponsive until for seconds or minutes, depending
Based upon my crash-course, this may be a better solution (but need more coding):
https://www.php.net/manual/en/function.opcache-invalidate.php
and there could still be other issues.
How do other installers, etc. handle it? (noting that installing new files is less problematic than file changes/ overwrites)
IIRC when I upgraded a plugin it updates instantly but it is seconds later before it says plugin ‘reactivated’.