Good question, thank you!
You don’t have to let the cache grow until it stops growing. There are subsystems (like WP_Query) that put non-expiring items into the cache, use them for a while, then forget about them. So the cache will keep growing if you let it. (This messes up people who use Redis, because Ubuntu server’s default config for that cache system doesn’t set a maximum size limit.)
Also, a recent release flushes the cache upon software installation / update (new or revised plugins, themes, core). So it will get cleaned up once in a while on an active site.
If I were you I would set the size to 128MiB and leave it there for a month or so. Then revisit it.
Thread Starter
heel1
(@heel1)
Hi Ollie,
But when I revisit it after a month, what to look for and how to decide if it is too small, too big, or in the sweet spot?
I understand not everything needs to be in there probably, if the most asked queries are in there it will probably serve its purpose the best I guess.
Probably even can do some harm to let it grow big and huge with old and not often used queries, the file just grows big using storage, and probably slower to retrieve anything out off it.
So what is optimum, should it be set to 10% off your database size? Or to 25% off your database size?
Or shoudl I look at this from another perspective?
What I mean is for example for InnoDB buffer pool size I understand it is best if you can give it more space then database size, so this is a clear guideline, I understand clearly what to do as best practice. I am hoping for a clear guideline for object cache as well, how to determine the optimum setting.
Many thanks)