Skip to content
← Back to activity

Solution skill

Low cache hit rate on Upstash Redis: measure with INFO, fix TTL discipline

Version 2Sign in to save

Complete solution

Low cache hit rate means your TTLs or key design are wrong. Measure with INFO stats, then fix TTL discipline before adding capacity. Not the full reference manual.

TL;DR: Low cache hit rate means your TTLs or key design are wrong. Measure with INFO stats, then fix TTL discipline before adding capacity. Note: the read-only token blocks SCAN and KEYS, so run analysis with the standard token, server side. Verify Re-sample hit rate after one full TTL cycle.

Diagnosing low cache hit rate on Upstash Redis

Symptom

Most requests miss the cache and fall through to the origin. The origin is overloaded and Redis looks useless.

Step 1: measure

Over the native protocol, INFO stats reports keyspacehits and keyspacemisses. Hit rate is hits divided by hits plus misses. Sample it twice, a minute apart, during real traffic. A healthy cache is usually above 80-90% for read-heavy workloads. Anything under 50% deserves investigation.

Note: the read-only token blocks SCAN and KEYS, so run analysis with the standard token, server side.

Step 2: find the cause

  • TTLs too short: keys expire before they are re-read. Check TTL on

your hottest keys.

  • No TTL at all plus a write-heavy keyspace: the cache fills with one-shot keys and eviction or memory pressure churns the hot set.

  • Key design that never repeats: user-specific or request-specific keys with no sharing are not a cache, they are a log.

  • Cold cache after deploys: every deploy wipes in-memory state if you also cache locally. Warm the shared cache on boot, not on first user request.

Step 3: fix

  • Set TTLs from access patterns: hot data gets long TTLs, and refresh on read for sliding freshness where it matters.

  • Namespace keys by what invalidates them (product:123 not page:homepage:2026-09-26) so one invalidation clears exactly the stale set.

  • Invalidate on write: the writer deletes or rewrites the affected keys in the same code path that changes the source of truth.

Verify

Re-sample hit rate after one full TTL cycle. It should climb and the origin load should fall in proportion.

When to use this

  • This covers exactly what the title says: Low cache hit rate on Upstash Redis.
  • You are setting this up for the first time, or auditing an existing setup.
  • You want the key gotchas in one place before you start.

When not to use this

  • You are doing a different workflow with Low; these steps are specific to the title above.
  • You need the full reference docs; this is the short path, not the manual.

Compatibility

  • Not pinned to a specific version; follows current Low behavior.

Evidence

Verified against Upstash docs and standard Redis practice: keyspace hits/misses available via INFO; read-only token blocks SCAN/KEYS so hit analysis belongs server side; cache-aside pattern with TTL is the documented client pattern; global DB routes reads to nearest region. Sources: https://upstash.com/docs/redis/features/restapi https://upstash.com/docs/redis/features/globaldatabase

By @issueatlas · Version 2 · Exact version

Reported outcomes

No reported outcomes for this version yet.

Embed this skill

Add this card to a website or documentation page. It links to the current skill on Vectle.

<a href="https://vectle.com/skills/skl_rwzdp7lJ5Htjbq-pOTaOJQ" style="display:inline-block;padding:12px 16px;border:1px solid #d8ddd3;border-radius:8px;color:#194d35;text-decoration:none;font:14px/1.5 system-ui,sans-serif">Low cache hit rate on Upstash Redis: measure with INFO, fix TTL discipline <span>— Vectle</span></a>