Redis monitoring: the metrics that matter for memory usage, evictions, latency and replication

Which INFO fields to collect, how eviction policies behave, how to find slow commands, big keys and hot keys, what changes with Cluster and Sentinel, and how to collect Redis metrics with OpenTelemetry or redis_exporter.

Obseria TeamObseria
Summary
  • Redis monitoring starts with INFO: used_memory against maxmemory, mem_fragmentation_ratio, evicted_keys, keyspace hits and misses, connected and blocked clients, rejected connections and persistence and replication status.
  • The eviction policy decides what happens when memory runs out: noeviction returns errors on writes, the allkeys and volatile policies delete keys. Which one is right depends on whether the instance is a cache, a queue or a primary store.
  • Latency problems in Redis usually come from slow commands, big keys, fork for persistence or the network. SLOWLOG, the latency monitor and redis-cli --bigkeys find them, and OpenTelemetry or redis_exporter turn INFO into metrics.

Redis monitoring looks simple at first: one process, one port, one INFO command that returns everything. In practice the important questions are hidden in the details. Is the instance about to hit maxmemory? Are keys being evicted that the application expects to find? Is one slow command blocking every other client? Is the replica minutes behind? Because Redis executes commands on a single main thread, one bad pattern affects every caller, and the symptoms often appear first as latency in the services that use it.

This guide covers the Redis metrics that matter: memory usage and fragmentation, eviction policies, hit rate, clients, throughput, persistence and replication. It shows how to investigate Redis latency with SLOWLOG and the latency monitor, how to find big keys and hot keys, what changes with Redis Cluster and Sentinel, and how to collect everything with the OpenTelemetry Collector or redis_exporter. A metrics table, example alerts and a checklist close it. For the relational side of your data layer, see our guide to database monitoring and slow queries.

A note on Redis, Valkey and licensing

In 2024 Redis changed its license from BSD to a dual source-available model (RSALv2 and SSPLv1). In response, the Linux Foundation launched Valkey, a fork of the last BSD-licensed Redis release, with support from several cloud providers. With Redis 8 in 2025, AGPLv3 was added as an additional license option. Many managed services now offer Redis, Valkey or both.

For monitoring, the practical point is that Valkey and Redis share the same protocol and largely the same INFO fields, so the metrics in this guide apply to both. Newer releases on each side add their own fields and features, so check the documentation for the exact version you run. Licensing questions for your own use are a matter for your legal review.

Redis memory usage: used_memory, RSS and fragmentation

Redis keeps the whole dataset in memory, so memory is the first resource to monitor. INFO memory returns the key fields:

  • used_memory: bytes allocated by Redis through its allocator, the logical size of data plus overhead.
  • used_memory_rss: resident set size as seen by the operating system. This is what counts against container limits and what the OOM killer sees.
  • used_memory_peak: the highest used_memory since start, useful for capacity planning.
  • maxmemory and maxmemory_policy: the configured limit and what happens when it is reached. A maxmemory of 0 means no limit on 64-bit systems, which in a container usually means the container limit decides instead.
  • mem_fragmentation_ratio: roughly used_memory_rss divided by used_memory.

The fragmentation ratio needs interpretation. A value somewhat above 1 is normal. A clearly higher value (for example above 1.5, as an example value) means the allocator holds memory that Redis no longer uses, often after many deletes or changes in value sizes; with jemalloc, the activedefrag setting can reclaim some of it at runtime. A value below 1 means that part of Redis memory has been swapped out, which causes severe latency and should be treated as urgent. On very small datasets the ratio is noisy and not meaningful.

The most useful single number is used_memory as a share of maxmemory. Also keep headroom for RSS above used_memory: persistence forks use copy-on-write, so a BGSAVE or AOF rewrite under heavy writes can temporarily increase total memory. Size the host or container for that, not only for the dataset.

Evictions, expirations and eviction policies

Two counters in INFO stats describe how keys leave Redis:

  • expired_keys: keys removed because their TTL ran out. This is normal and expected for caches.
  • evicted_keys: keys removed because maxmemory was reached. Whether this is acceptable depends on the role of the instance.

The maxmemory-policy setting decides what Redis does at the limit:

PolicyBehaviourTypical use
noevictionRejects writes that need more memory with an error; reads still workQueues, Celery or Sidekiq brokers, primary data. Default.
allkeys-lruEvicts the least recently used keys among all keysGeneral-purpose cache
allkeys-lfuEvicts the least frequently used keys among all keysCache with a stable set of popular keys
allkeys-randomEvicts random keysRarely the best choice
volatile-lru, volatile-lfu, volatile-randomSame, but only among keys with a TTLMixed instances where keys without TTL must survive
volatile-ttlEvicts keys with the shortest remaining TTL firstCaches where expiry time reflects value

LRU and LFU in Redis are approximations based on sampling (maxmemory-samples), not exact orderings. With a volatile-* policy and no keys that have a TTL, Redis behaves like noeviction and starts rejecting writes.

Read evictions in context. On a pure cache, a steady low eviction rate means the cache is full and working. A sudden jump means the working set no longer fits, and the hit rate usually drops at the same time. On a queue or broker instance, any eviction is a data loss incident. With noeviction, watch for OOM command not allowed errors in the client libraries, because Redis itself keeps running.

Cache hit rate: keyspace_hits and keyspace_misses

For cache workloads, the hit rate shows whether Redis does its job:

hit_rate = keyspace_hits / (keyspace_hits + keyspace_misses)

Both counters are cumulative since start (or since CONFIG RESETSTAT), so compute the rate over a time window from their increase, not from absolute values. Interpret it with care:

  • The counters are instance-wide. If one instance serves several applications or key patterns, a good total can hide a poor hit rate for one of them. Application-side metrics per cache name help here.
  • Misses are not always bad. Lookups for keys that legitimately do not exist, such as negative caching checks or rate limit counters, count as misses.
  • A sudden drop after a deployment often means a changed key format or TTL. A drop after a restart or failover is a cold cache, and it can trigger a thundering herd against the database behind it.

Treat the hit rate as a baseline metric: alert on a significant drop compared with the usual value for that instance, not on a fixed number.

Clients, connections and throughput

INFO clients and INFO stats describe the load on the instance:

  • connected_clients: open client connections. Compare with maxclients (10000 by default, possibly lower if the file descriptor limit is lower). A steady climb usually means a connection leak or missing connection pooling in a client.
  • blocked_clients: clients waiting in blocking commands such as BLPOP, BRPOP, BLMOVE or XREAD BLOCK. For queue consumers this is normal and roughly equals the number of idle consumers. A sudden change is worth a look.
  • rejected_connections: connections refused because maxclients was reached. Any increase is an incident for the clients affected.
  • instantaneous_ops_per_sec: commands per second, sampled. For trends, derive a rate from total_commands_processed instead.
  • total_connections_received: a high rate of new connections suggests clients that connect per request instead of reusing a pool, which adds latency and CPU load.

INFO commandstats breaks calls and time down per command. It quickly shows whether a growing share of time goes to expensive commands such as KEYS, SMEMBERS on large sets or Lua scripts.

Persistence and replication status

If the instance persists data, INFO persistence tells you whether persistence actually works:

  • rdb_last_bgsave_status should be ok. A failed snapshot means the on-disk copy is getting older. Depending on stop-writes-on-bgsave-error, Redis may also refuse writes.
  • rdb_changes_since_last_save and rdb_last_save_time show how much data would be lost in a crash.
  • aof_enabled, aof_last_write_status and aof_last_bgrewrite_status show the state of the append-only file.
  • latest_fork_usec (in INFO stats) is the duration of the last fork. Forking a large dataset can take long enough to cause a visible latency spike.

For replication, INFO replication on the primary shows role, connected_slaves and one line per replica with its state, offset and lag. The replication lag in bytes is the difference between the primary's master_repl_offset and the replica's acknowledged offset. On the replica, master_link_status should be up, and master_last_io_seconds_ago shows when it last heard from the primary. Watch for repeated full resynchronisations as well: if the replication backlog (repl-backlog-size) is too small for the write rate, a short network interruption forces a complete resync, which costs a fork and network bandwidth.

Redis latency: SLOWLOG, LATENCY DOCTOR and the latency monitor

Redis latency as the application sees it has several parts: network round trip, waiting in line behind other commands on the main thread, and execution time. Each needs its own tool.

SLOWLOG records commands whose execution time exceeded slowlog-log-slower-than (in microseconds, 10000 by default) and keeps the last slowlog-max-len entries (128 by default). It measures execution only, not network or queueing time.

redis-cli SLOWLOG GET 10        # last 10 slow commands with duration and arguments
redis-cli SLOWLOG LEN
redis-cli CONFIG SET latency-monitor-threshold 100   # example value in ms
redis-cli LATENCY LATEST
redis-cli LATENCY DOCTOR
redis-cli --latency-history -i 15

The latency monitor records latency events such as slow commands, fork and expiry cycles above latency-monitor-threshold (in milliseconds; 0 disables it). LATENCY LATEST and LATENCY HISTORY show the events, and LATENCY DOCTOR gives a human-readable analysis with hints. redis-cli --latency and --latency-history measure round trips from the client side, and --intrinsic-latency, run on the server host, shows the latency the host itself introduces, for example through a noisy virtual machine.

Common causes of Redis latency:

  • O(N) commands on large data: KEYS * (use SCAN), HGETALL, SMEMBERS or LRANGE 0 -1 on huge keys, DEL of a big key (use UNLINK for asynchronous freeing).
  • Fork for persistence on a large dataset, visible as latest_fork_usec and in the latency monitor. Transparent huge pages make this worse, and Redis logs a warning at startup if they are enabled.
  • Swapping, visible as a fragmentation ratio below 1.
  • Mass expiry when many keys share the same TTL and expire at once.
  • Network and client issues: saturated network, many new connections, or large pipelines.

From the application side, measure Redis call duration as percentiles. Client spans from OpenTelemetry instrumentation give you the full latency including network and queueing, and their tail latency is often the first sign of trouble. Our article on debugging latency spikes shows how to follow such a spike across services.

Big keys and hot keys

A single key that is very large or very popular can dominate memory, latency or, in a cluster, the load of one shard.

  • redis-cli --bigkeys scans the keyspace with SCAN and reports the largest key per type by element count. redis-cli --memkeys does the same by memory usage. MEMORY USAGE <key> returns the size of one key.
  • redis-cli --hotkeys reports frequently accessed keys. It relies on access frequency counters and therefore requires an LFU maxmemory-policy.

Both scans add load, so run them against a replica or outside peak hours. The usual fixes are splitting a big key into several smaller ones, adding a local in-process cache in front of a hot key, or spreading hot data across several keys.

Redis Cluster and Sentinel

With high availability or sharding, monitor the topology in addition to each node:

  • Redis Cluster. CLUSTER INFO returns cluster_state (should be ok) and slot counts such as cluster_slots_assigned, cluster_slots_pfail and cluster_slots_fail. Collect every per-node metric from every primary and replica, and compare memory and ops per second across shards: an uneven distribution points to hot slots or big keys.
  • Sentinel. Sentinel monitors primaries and promotes a replica on failure. Track the number of Sentinels that see each primary, and alert on failover events (+switch-master in Sentinel's log or Pub/Sub). A failover is often harmless, but frequent failovers point to network or resource problems.

After every failover, check that clients follow the new primary, and expect a temporary dip in hit rate if the new primary's dataset differs.

Collecting Redis metrics: OpenTelemetry Collector or redis_exporter

Two common ways turn INFO into time series:

  • OpenTelemetry Collector with the redis receiver (part of the contrib distribution). It connects to each instance, runs INFO at a configured interval and emits metrics such as redis.memory.used, redis.keys.evicted, redis.clients.connected and redis.commands.processed. Metric names can change between receiver versions, so check the documentation for the version you deploy.
  • redis_exporter for Prometheus exposes metrics such as redis_memory_used_bytes, redis_evicted_keys_total, redis_keyspace_hits_total and redis_connected_clients. The Collector's Prometheus receiver can scrape it and forward the data via OTLP.
receivers:
  redis:
    endpoint: redis-primary:6379
    collection_interval: 15s
    password: ${env:REDIS_PASSWORD}

exporters:
  otlp:
    endpoint: otel-gateway:4317

service:
  pipelines:
    metrics:
      receivers: [redis]
      exporters: [otlp]

Use a dedicated Redis user with ACLs that allow INFO and the other read-only commands the collector needs, rather than the default user. Add client-side telemetry too: OpenTelemetry instrumentations for Redis clients in Python, Java, Node.js, Go and other languages create spans for each command, so you see Redis time inside each request trace. Our guide to running the OpenTelemetry Collector in production covers the deployment side, and the Redis integration page shows the setup for Obseria.

Key Redis metrics at a glance

AreaINFO field or derived metricWhat it tells you
Memoryused_memory / maxmemoryHow close the instance is to the limit
Memoryused_memory_rss, container memoryReal memory use, OOM risk
Memorymem_fragmentation_ratioFragmentation (high) or swapping (below 1)
KeysRate of evicted_keysMemory pressure; data loss on non-cache instances
KeysRate of expired_keysTTL behaviour, mass expiry
CacheHit rate from keyspace_hits and keyspace_missesCache effectiveness
Clientsconnected_clients / maxclientsConnection leaks, missing pooling
Clientsblocked_clients, rejected_connectionsBlocking consumers, refused connections
Throughputinstantaneous_ops_per_sec, total_commands_processedLoad and trends
LatencySLOWLOG entries, client-side p99Slow commands, user-visible latency
Persistencerdb_last_bgsave_status, aof_last_write_status, latest_fork_usecDurability and fork cost
Replicationmaster_repl_offset minus replica offset, master_link_statusReplication lag and broken links
Clustercluster_state, cluster_slots_failCluster health

Example alerts for Redis

All thresholds below are example values. Adjust them to the role of each instance (cache, queue, session store, primary data) and to your own baseline.

  • Memory (example). used_memory above 85 % of maxmemory for 15 minutes, or container RSS above 90 % of the limit.
  • Evictions on a non-cache instance (example). Any increase of evicted_keys on an instance used as broker, queue or primary store.
  • Eviction spike on a cache (example). Eviction rate more than five times the 7-day baseline for 10 minutes.
  • Hit rate drop (example). Hit rate more than 20 percentage points below its usual value for 15 minutes.
  • Swapping (example). mem_fragmentation_ratio below 1 for 5 minutes on an instance with a non-trivial dataset.
  • Connections (example). connected_clients above 80 % of maxclients, or any increase in rejected_connections.
  • Persistence (example). rdb_last_bgsave_status or aof_last_write_status not ok.
  • Replication (example). master_link_status down on any replica for 1 minute, or replication lag growing for 5 minutes.
  • Latency (example). Client-side p99 of Redis calls above 10 ms for 10 minutes, or a burst of new SLOWLOG entries.

Common questions about Redis monitoring

What are the most important Redis metrics?

Memory used against maxmemory, evictions, hit rate, connected and rejected clients, client-side latency, and persistence and replication status. Together they cover most Redis incidents.

What does mem_fragmentation_ratio mean?

It compares the memory the operating system has given Redis with the memory Redis has allocated. Well above 1 means fragmentation, below 1 means swapping.

Why is Redis slow although CPU looks fine?

Redis runs commands on one main thread, so a single slow command blocks the others while overall CPU stays moderate. Check SLOWLOG, the latency monitor, big keys and the last fork duration.

Redis monitoring checklist

Copy this checklist into your team backlog

  • Role of each instance documented: cache, queue or broker, session store, primary data
  • maxmemory set explicitly and below the container or host limit, with headroom for forks
  • maxmemory-policy chosen per role; noeviction on queues and brokers
  • used_memory, RSS and mem_fragmentation_ratio collected and graphed
  • Rates of evicted and expired keys, and hit rate from hits and misses
  • connected_clients, blocked_clients and rejected_connections against maxclients
  • Client-side latency percentiles from application traces
  • SLOWLOG threshold and latency monitor configured; SLOWLOG reviewed regularly
  • No KEYS in production code; SCAN and UNLINK used for large keyspaces and keys
  • Periodic big key and hot key scans against a replica
  • Persistence status, fork duration and last save time monitored
  • Replication link status and lag per replica; replication backlog sized for the write rate
  • Cluster state and slot health, or Sentinel failover events, alerted
  • Collection via OpenTelemetry Collector redis receiver or redis_exporter with a least-privilege ACL user
  • Alerts labelled with example thresholds, tuned to each instance's role and baseline

How Obseria helps with Redis monitoring

Obseria is an OpenTelemetry-native observability platform. Redis metrics from the Collector's redis receiver or from redis_exporter arrive alongside the client spans from your applications, so you see both the server side and what each service experiences. When cache latency rises, you can check memory, evictions and slow commands on the instance and the affected requests in the same place.

  • Obseria Intelligence connects a drop in hit rate or a latency spike with deployments, failovers and database load, and shows the evidence for each suspected cause.
  • Baseline-driven alerting flags unusual eviction rates and hit rate drops per instance, without a fixed threshold for every cache.
  • Database monitoring in Obseria puts Redis next to PostgreSQL, MySQL and other data stores.

Start with the Redis integration, or book a demo to see your own instances in Obseria.

Share

Observability that delivers answers.

Start for free with OpenTelemetry, no credit card required.