I’m currently using Plesk for a shared hosting server, this allows me to give every website it’s own PHP-FPM handler. This also means that every website has it’s own seperate Opcache.
The issue with this is that every site can fill it’s own cache.
Let’s say there are 10 sites with 64 MB for Opcache, that’s 640 MB in total!
Lot’s of those sites don’t get visited regularly, so the cache could be cleared after a while.
A solution could be to restart the PHP-FPM process for every site, but this will result in errors for visitors.
Another solution would be 1 PHP-FPM handler, but the cache will get filled by the big sites.
This results in automatic Opcache restarts because the memory is full.
My question: is there a way to reset the cache periodically, or is there a way to clear the files from the cache when they haven’t been access for let’s say a week?