Reputation: 128
Is there a way to flush my GCP Redis when a trigger is triggered?
In my specific case, I'm using the Google StackDriver metrics to monitor and get notified. I want that when my Redis memory is above 90% it will automatically flush. Is there a way to perform this?
Upvotes: 2
Views: 1813
Reputation: 767
Scaling a Basic Tier instance flushes the cache so my suggestion is to configure the instance with a smaller cap (& appropriate eviction policy) then have it scale as needed.
gcloud redis instances update instance-id --update-redis-config maxmemory-policy=policy
Alternatively, you can setup a web service to make the appropriate CLI command, but this requires a little more effort.
Upvotes: 4