The INFO command section by section (server, clients, memory, stats, replication, keyspace), SLOWLOG for identifying slow commands, LATENCY HISTORY, MONITOR for live command tracing, and the 10 metrics every Redis dashboard must have.
Who this module is for: You have a Redis instance in production but no visibility into what it is doing — what commands are slow, whether memory is healthy, how close you are to hitting limits. This module covers the full observability surface: INFO sections, SLOWLOG, LATENCY, MONITOR, and the 10 metrics every Redis dashboard must include.
The INFO Command
INFO is the primary observability tool. It returns a structured plaintext report across multiple sections. You can request all sections or a specific one:
text
INFO server
text
uptime_in_seconds matters for fragmentation analysis — fragmentation grows over time and a very long uptime with high key churn warrants active defragmentation.
INFO clients
text
Watch connected_clients approaching maxclients. Watch client_recent_max_output_buffer — a large output buffer means slow clients accumulating data faster than they read.
INFO stats — The Most Important Section
text
Cache hit rate = keyspace_hits / (keyspace_hits + keyspace_misses)
For the example above: 921847392 / (921847392 + 26426449) = 97.2% — healthy.
Below 90%: investigate why. Causes: TTLs too short, maxmemory too small, cache warming not working, wrong key patterns.
evicted_keys > 0: Your cache is under memory pressure. Redis is actively deleting data to make room. Increase maxmemory or reduce your dataset.
rejected_connections > 0: You have hit maxclients. Increase the limit or fix connection leaks.
INFO replication
text
lag = replication lag in seconds for each replica. A non-zero lag means the replica is behind.
repl_backlog_size — if a replica disconnects and reconnects with an offset that is no longer in the backlog, it requires a full resync (expensive). Increase repl-backlog-size if replicas frequently reconnect: CONFIG SET repl-backlog-size 64mb.
INFO keyspace
db0:keys=142883,expires=141204,avg_ttl=3591847
expires vs keys ratio — if expires << keys, most of your keys have no TTL. For a cache, this is a problem: memory fills up without natural eviction.
avg_ttl — average remaining TTL in milliseconds. If this is very short (< 60,000 = 60 seconds), keys are expiring rapidly and you may have high expiry overhead.
INFO commandstats
text
usec_per_call — microseconds per command call. High values for specific commands reveal which commands are slow. In the example, HGETALL at 100µs vs GET at 5µs — these HGETALL calls are expensive (likely large Hashes).
INFO latencystats (Redis 7.0+)
text
Per-command latency percentiles. p99.9 for HGETALL at 2,140µs (2ms) is a signal that some HGETALL calls are very expensive — likely on large Hashes that crossed the listpack→hashtable threshold.
SLOWLOG
SLOWLOG records commands that exceed a configurable latency threshold.
text
text
text
Common slow command findings:
KEYS * — scans all keys, blocks Redis. Replace with SCAN.
HGETALL large_hash — Hash in hashtable encoding with thousands of fields.
SMEMBERS large_set — returns all Set members at once. Use SSCAN.
SORT — sorts a List or Set; O(N+M log M). Computationally expensive.
LRANGE key 0 -1 — returns entire List. Cache long lists with pagination.
Set slowlog-log-slower-than 1000 (1ms) in development to catch all slow commands during development and testing. In production, use 10,000–20,000µs to avoid log noise.
LATENCY Monitoring
Redis has a built-in latency monitoring system that tracks event-level latency — not per-command, but per internal event type (fork, AOF flush, RDB save, etc.).
text
text
Event names to watch:
fork — BGSAVE/BGREWRITEAOF fork latency (high = large dataset or memory pressure)
aof-stat — AOF write latency (high = disk I/O bottleneck)
rdb-* — RDB save events
command — command execution latency (aggregate)
MONITOR: Live Command Stream
MONITOR
MONITOR streams every command executed by every client in real time. It is invaluable for debugging unexpected behaviour ("what is sending KEYS * in production?") but adds 50%+ CPU overhead. Never leave MONITOR running in production.
Use it briefly to identify which clients are issuing which commands, then disconnect immediately.
CLIENT LIST and CLIENT INFO
text
text
Key fields:
cmd — last command issued by this client
age — seconds since connection was established
sub — number of channels subscribed
omem — output buffer memory (large = slow client)
flags — b = blocked (BLPOP), S = subscriber
Identify stuck clients: CLIENT LIST + filter for cmd=blpop with high age values.
The 10 Metrics Every Redis Dashboard Must Include
#
Metric
Source
Alert Threshold
1
Cache hit rate
keyspace_hits / (hits + misses)
< 90%
2
Evicted keys/sec
evicted_keys delta
> 0
3
Memory fragmentation ratio
mem_fragmentation_ratio
> 1.5 or < 1.0
4
Memory used / maxmemory
used_memory / maxmemory
> 80%
5
Connected clients
connected_clients
> 80% of maxclients
6
Ops per second
instantaneous_ops_per_sec
Baseline ± 3σ
7
Replication lag
slave.lag (INFO replication)
> 5 seconds
8
Slow commands
SLOWLOG LEN delta
Any increase
9
Last BGSAVE status
rdb_last_bgsave_status
err
10
Rejected connections
rejected_connections delta
> 0
Export these metrics from INFO every 15–60 seconds to your monitoring system (Prometheus via redis_exporter, Datadog, CloudWatch, etc.).
redis-cli Monitoring Shortcuts
bash
redis-cli --bigkeys scans the entire keyspace using SCAN and samples key sizes — it reports the largest key per type. Safe to run on production (uses cursor-based scan, not blocking KEYS *).
Summary
INFO is the starting point — use INFO stats for throughput and hit rate, INFO memory for memory health, INFO replication for lag, INFO keyspace for key distribution
Cache hit rate (keyspace_hits / total) should be > 90% — below this, investigate TTLs, eviction, and cache warming
evicted_keys > 0 means memory pressure — increase maxmemory or reduce dataset
SLOWLOG GET reveals expensive commands — the most common findings: KEYS *, HGETALL on large hashes, SORT
MONITOR streams live commands — invaluable for debugging, catastrophic if left running in production
CLIENT LIST identifies slow/stuck clients by output buffer size and command age
Export INFO metrics every 15–60 seconds to your monitoring system; build dashboards around the 10 core metrics
Next: P-12 — Security: ACLs, TLS, and Network Hardening — per-user command restrictions, TLS for in-transit encryption, bind address configuration, and the most common Redis security misconfigurations.
Knowledge Check
A Redis cache is exhibiting a 75% cache hit rate (keyspace_hits / (keyspace_hits + keyspace_misses)), and the monitoring dashboard shows evicted_keys consistently hovering above zero. Which of the following is the most likely root cause and the appropriate remediation?
An application experiences periodic latency spikes. An engineer runs the MONITOR command in the production Redis instance to debug the issue. Within seconds, the latency spikes become continuous, and the Redis CPU utilization hits 100%. What happened?
You want to find out if there are any specific, computationally expensive queries slowing down the Redis event loop. You execute SLOWLOG GET 10. The log shows multiple entries for HGETALL commands taking over 15,000 microseconds (15ms). Which of the following is the most direct way to resolve this specific bottleneck?
Test your knowledge with more question sets
Sign in to access a wider variety of questions and get notified when new practice sets are added to this module.
INFO → all sections
INFO server → server metadata
INFO clients → connected client counts
INFO memory → memory usage and fragmentation
INFO stats → command stats, hit/miss rates
INFO replication → primary/replica state
INFO cpu → CPU time consumed
INFO keyspace → per-database key counts and TTL stats
INFO persistence → RDB/AOF state
INFO commandstats → per-command call counts and latency
INFO latencystats → latency percentiles per command (Redis 7.0+)
redis_version: 7.2.4
os: Linux 5.15.0-92 x86_64
arch_bits: 64
tcp_port: 6379
uptime_in_seconds: 864000 → 10 days of uptime
hz: 10 → event loop frequency (affects expiry and other timers)
configured_hz: 10
aof_rewrites: 14
rdb_changes_since_last_save: 1423
total_commands_processed: 948273841
total_connections_received: 1284723
rejected_connections: 0 → > 0 means you hit maxclients
expired_keys: 4829341 → total keys expired since start
evicted_keys: 0 → should be 0; > 0 means memory pressure
keyspace_hits: 921847392 → commands that found their key
keyspace_misses: 26426449 → commands that returned nil
pubsub_channels: 3
pubsub_patterns: 1
instantaneous_ops_per_sec: 42841 → current throughput
instantaneous_input_kbps: 6284
instantaneous_output_kbps: 12847
total_net_input_bytes: 48293847192
total_net_output_bytes: 98473829384
CONFIG SET slowlog-log-slower-than 10000 → log commands slower than 10ms (10,000µs)
CONFIG SET slowlog-max-len 128 → keep last 128 slow commands
SLOWLOG GET 10 → show last 10 slow commands
SLOWLOG LEN → count of entries in the log
SLOWLOG RESET → clear the log
127.0.0.1:6379> SLOWLOG GET 3
1) 1) (integer) 42 → log entry ID
2) (integer) 1717000000 → Unix timestamp
3) (integer) 14823 → execution time in microseconds (14.8ms)
4) 1) "KEYS" → the command
2) "*"
5) "10.0.1.100:52394" → client address
6) "myapp" → client name (set with CLIENT SETNAME)
2) 1) (integer) 41
2) (integer) 1717000000
3) (integer) 12100
4) 1) "HGETALL"
2) "user:99999" → this specific key is slow
5) "10.0.1.100:52395"
6) "myapp"
CONFIG SET latency-monitor-threshold 100 → track events with latency > 100ms
LATENCY LATEST → most recent latency sample per event
LATENCY HISTORY event-name → historical latency for an event
LATENCY RESET [event-name] → clear latency history
127.0.0.1:6379> LATENCY LATEST
1) 1) "aof-stat"
2) (integer) 1717000000 → timestamp
3) (integer) 120 → latency in ms
4) (integer) 350 → max latency seen
# Live stats (refreshes every second)redis-cli --stat# Live latency monitoringredis-cli --latencyredis-cli --latency-history -i5# sample every 5 seconds# Live memory usageredis-cli --memkeys# memory usage per key pattern (sampling)# Count keys matching a patternredis-cli --scan--pattern"session:*"|wc-l# Big keys scan (find top memory consumers)redis-cli --bigkeys