Alex
When the OPcache get's full, because either the max files or max memory is reached your application(s) are slowing down because PHP has to constantly cleanup files to cache new files introducing added latency.
It would be great if Ploi can detect this and either reload FPM or increase the limits, it could detect this using this CLI tool (for example): https://github.com/gordalina/cachetool.
php cachetool.phar opcache:status
+----------------------+---------------------------------+
| Name | Value |
+----------------------+---------------------------------+
| Enabled | Yes |
| Cache full | Yes |
| Restart pending | No |
| Restart in progress | No |
| Memory used | 393.57 MiB |
| Memory free | 118.43 MiB |
| Memory wasted (%) | 0 b (0%) |
| Strings buffer size | 48 MiB |
| Strings memory used | 29.83 MiB |
| Strings memory free | 18.17 MiB |
| Number of strings | 235555 |
+----------------------+---------------------------------+
| Cached scripts | 16678 |
| Cached keys | 32531 |
| Max cached keys | 32531 |
| Start time | Sun, 30 Apr 2023 10:15:27 +0000 |
| Last restart time | Never |
| Oom restarts | 0 |
| Hash restarts | 0 |
| Manual restarts | 0 |
| Hits | 1143755979 |
| Misses | 81168886 |
| Blacklist misses (%) | 0 (0%) |
| Opcache hit rate | 93.373562059253 |
+----------------------+---------------------------------+
As you can see here, it hit the max cached files here in my instance causing the hit rate to be lower than it should. In this specific case, restarting FPM (and increasing the max allowed keys for good measure) resulted in a 100-150ms improvement on response times. I usually catch this myself when looking through monitoring but if Ploi could point this out or even have these stats available from the panel would be :chefs_kiss:.
Cristian Balan
@Denis, this is said to be Live but would be nice to have a comment explaining what was done.
Alex
Item authorA new insight was added:
See: https://twitter.com/ploi_deploy/status/1656356970918473736
New insight: OPcache full
-
Dennis moved item to board Live
1 year ago -
Dennis moved item to board In progress
1 year ago -
Dennis moved item to board Planned
1 year ago -
Alex moved item to project Panel Requests
1 year ago -
Alex created the item
1 year ago