Redis › Redis Monitoring & Observability
How do you use the LATENCY command family in Redis to identify specific sources of delay within the server's internal operations?
IntermediateAnswer
You enable latency monitoring with CONFIG SET latency-monitor-threshold, and then use commands like LATENCY HISTORY and LATENCY LATEST to see detailed information about specific events, such as slow fork operations during background saves or expired key cleanup cycles, that have caused measurable delay, helping pinpoint exactly what internal Redis process might be contributing to overall latency.
CONFIG SET latency-monitor-threshold 100
LATENCY LATEST
LATENCY HISTORY commandReal-world example A database administrator uses the LATENCY command family to discover that fork operations during background saves were the primary source of intermittent latency spikes, leading them to adjust their persistence configuration accordingly.