DBAtlas · Database operations atlas

Diagnose the source of latency (LATENCY DOCTOR, histogram, commandstats)

RedisPerformance

Command

# Enable the latency monitor (record events above 100 ms):
CONFIG SET latency-monitor-threshold 100
LATENCY LATEST
LATENCY HISTORY command
LATENCY DOCTOR
# Per-command latency distribution and percentiles:
LATENCY HISTOGRAM GET SET HGETALL
INFO latencystats
# Most expensive commands by total CPU time:
redis-cli -h redis1 -p 6379 INFO commandstats | sort -t= -k3 -rn | head
# On the server host, baseline latency outside Redis (VM/steal detection, 30 s):
redis-cli --intrinsic-latency 30
LATENCY RESET

What it does

The latency monitor records latency spikes from events such as fork, AOF fsync, the expire cycle and slow commands; shows per-command latency percentiles and the most expensive commands by total CPU time; measures baseline latency at host level.

When to use it

When the application sees p99 latency spikes and slowness complaints continue even though SLOWLOG is clean.

Caution

latency-monitor-threshold defaults to 0 (off); restore the old value after the diagnosis. SLOWLOG only measures command execution time and does not see network or queue waits; LATENCY events also capture in-server stalls such as fork and fsync. --intrinsic-latency consumes CPU and must run on the machine hosting the Redis server.

Open in DBAtlas →

Related