We sometimes clear out the gcache files on a system if they get really big. In our lab I noticed that two random servers of the four did not have gcache files at all? Is there any reasonable reason for this? Our four production servers (have different settings) have the cache evenly distributed. I’m just curious if it could be because two of the DBs were offline at times or it happens naturally for some reason. Thoughts?
Hi @Mike_Q welcome to the Percona forums!
gcache files represent the accrued changes in the cluster up to a certain file size on disk and is controlled by
gcache.size parameter. You should not have to do any maintenance on these files as they should be automatically cleaned up since it is a permanent ring buffer file.
So in your case having a server with no gcache is odd, unless there are zero writes occurring in the cluster
You may also want to examine the error logs on your lab servers, as you will see evidence of an active PXC node cleaning up old gcache files, similar to:
2022-04-28T20:20:50.874480Z 0 [Note] [MY-000000] [Galera] Created page /var/lib/mysql/gcache.page.000000 of size 739615928 bytes 2022-04-28T20:21:02.575596Z 0 [Note] [MY-000000] [Galera] Deleted page /var/lib/mysql/gcache.page.000000