Redis in ProductionLesson 6.5
Monitoring Redis with INFO, MONITOR, SLOWLOG, and latency commands
INFO sections, DBSIZE, MONITOR command, SLOWLOG GET, slowlog-log-slower-than, LATENCY HISTORY, memory usage analysis, redis-cli --stat, OBJECT FREQ for LFU
Observing Redis in production
Redis exposes rich internal metrics. Learn to read them before you need them in an incident.
INFO — snapshot of everything
redis-cli INFO memory # used_memory, mem_fragmentation_ratio
redis-cli INFO stats # total_commands_processed, keyspace_hits/misses
redis-cli INFO replication # role, connected_slaves, repl_offset
# Cache hit ratio
# keyspace_hits / (keyspace_hits + keyspace_misses)SLOWLOG — find slow commands
# redis.conf: log commands slower than 10ms
slowlog-log-slower-than 10000
SLOWLOG GET 10 # last 10 slow commands
# Shows: id, timestamp, duration_micros, command, argsMONITOR — live command stream
redis-cli MONITOR
# Streams every command in real time — WARNING: halves throughput
# Use only for debugging, never in production permanentlyLatency tracking
CONFIG SET latency-monitor-threshold 10 # ms
LATENCY LATEST
LATENCY HISTORY event_nameMemory analysis
redis-cli --bigkeys # find largest keys by type
redis-cli --memkeys # memory usage per key
MEMORY USAGE mykey # bytes for one key
redis-cli --stat # live rolling stats dashboard