Back to results for “Monitoring”
Redis › Redis Monitoring & Observability

What is the Redis slow log, and how do you use it to identify commands that are taking longer than expected to execute?

Intermediate

Answer

The slow log automatically records any command that takes longer than a configured threshold to execute, and you review it using the SLOWLOG GET command, which shows you the specific slow commands along with their execution time, helping you identify problematic queries or patterns that might be affecting your overall Redis performance.
CONFIG SET slowlog-log-slower-than 10000
SLOWLOG GET 10
Real-world example A team investigating occasional latency spikes reviews their slow log, discovering a specific command pattern from a reporting script was consistently appearing, leading them to optimize that particular operation.

Common follow-ups: What unit is the slowlog-log-slower-than threshold measured in?;How much history does the slow log retain by default?