Memorystore for Redis Performance & Failover Review Prompt
Review a Memorystore for Redis instance for latency spikes, eviction under memory pressure, failover behavior, and connection exhaustion — before it becomes a cache stampede that takes the app down.
- Target user
- Backend and SRE engineers running Memorystore for Redis (Standard tier with replication)
- Difficulty
- Advanced
- Tools
- Claude, ChatGPT, Cursor
The prompt
You are a senior reliability engineer who has watched a Memorystore instance drift into the eviction danger zone for weeks until a traffic spike triggered a mass eviction, a cache-miss storm, and a database meltdown. You reason from the instance metrics and the maxmemory policy, not from bumping the tier the moment latency blips. I will provide: - Instance facts: tier (Basic/Standard), size in GB, Redis version, `maxmemory-policy`, and whether read replicas are enabled - The symptom: latency spikes, evictions, OOM, connection refusals, or a failover that didn't behave as expected - Metrics: used memory vs. capacity, evicted/expired keys, cache hit ratio, connected clients vs. `maxclients`, CPU, and blocked clients - Command evidence: relevant `redis-cli INFO` sections (memory, stats, clients, keyspace) and any slowlog entries Your job: 1. **Classify the pressure** — memory (approaching maxmemory, evictions climbing), connections (near maxclients, refusals), CPU (a slow command or big-key scan), or availability (failover/replication lag). Name it before resizing. 2. **Memory and eviction** — read used-memory headroom and the eviction policy together. Explain what the current `maxmemory-policy` actually does under pressure (`noeviction` returns errors; `allkeys-lru` silently drops data), and whether the workload's key TTLs and sizes match that policy. Flag any big keys or unbounded collections. 3. **Connections** — check connected clients against maxclients and look for a connection leak or a missing client-side pool; refusals are usually a pooling bug, not an undersized instance. 4. **Failover and replication** — for Standard tier, reason about replica lag, the failover window, and whether the client reconnects and retries correctly; a "failover broke us" incident is often a client that doesn't handle a brief connection drop. 5. **Fix at the right layer** — right-size memory, change the eviction policy, fix the client pool, shard hot keys, or add read replicas — whichever the metrics prove. Do not jump a tier to mask a big-key or connection-leak problem. Output: (a) the pressure class, (b) the metric or INFO field that proves it, (c) the specific config or client change, (d) how to verify the hit ratio and latency recover, (e) what NOT to change. Bias toward the smallest change that removes the pressure and survives a failover. Show me the change before I resize a production instance.
Run this prompt with AI
Test it, get an AI-improved version, or compare models — live in the Prompt Workspace. No copy-paste.
Why this prompt works
Memorystore incidents almost always trace back to the interaction between used memory and the eviction policy, yet that pairing is the thing teams inspect last. An instance can run for weeks a hair under maxmemory, and the day traffic spikes it evicts en masse, every read misses, and the backing database absorbs the full load and falls over. This prompt forces the engineer to classify the pressure — memory, connections, CPU, or availability — before reaching for the resize button, which is the reflexive fix that hides the real cause.
The eviction branch is deliberately explicit about what each maxmemory-policy does, because the defaults surprise people: noeviction starts returning errors while allkeys-lru silently deletes data, and if that data is sessions or a queue rather than a pure cache, silent eviction is a correctness bug. The connections branch catches the other frequent culprit — a leaking client pool that presents as “the instance is too small” when it is really an application defect.
The failover framing matters because the safe-looking fix (resize, change tier) itself causes a failover, and the incident is often a client that never handled a brief disconnect. Keeping the change minimal, metric-backed, and reviewed before it touches production is what stops a cache tuning exercise from becoming a database outage.
Related prompts
-
Dataflow Pipeline Performance & Autoscaling Debug Prompt
Diagnose slow or stalled Dataflow jobs — pipelines that won't autoscale, workers stuck at high system lag, hot keys skewing throughput, and streaming backlogs that grow faster than they drain.
-
Cloud CDN & Cloud DNS Caching/Resolution Debug Prompt
Diagnose Cloud CDN cache-miss storms, stale content, and Cloud DNS resolution failures by reasoning from cache keys, TTLs, and response headers instead of flushing the cache and hoping.
-
Cloud SQL Performance & Connection Tuning Prompt
Diagnose Cloud SQL slowness and connection exhaustion — slow queries, max_connections limits, connector vs proxy choices, and flag tuning — using Insights and metrics, not blind instance upsizing.
-
Binary Authorization & Supply-Chain Security Review Prompt
Review a GKE/Cloud Run Binary Authorization policy for enforcement gaps, attestation coverage, break-glass misuse, and admission-blocking failures — so only trusted, verified images run in production.
More GCP with AI prompts & error guides
Browse every GCP with AI prompt and troubleshooting guide in one place.
Reading prompts? Get all 500 in one free PDF
500 battle-tested, copy-paste AI prompts engineered by a senior systems engineer — every one with fill-in placeholders and safety/back-out notes. Drop your email and it's yours.
- 500 prompts: Linux · Kubernetes · Terraform · OpenStack · GitLab · Docker · Monitoring · Incident Response
- Instant PDF download — yours free, forever
- Plus one practical AI-workflow email a week (no spam)
Single opt-in · unsubscribe anytime · no spam.