0
0
Redisquery~5 mins

Latency monitoring in Redis

Choose your learning style9 modes available
Introduction

Latency monitoring helps you see if your Redis server is slow at doing tasks. It shows delays so you can fix problems early.

You want to check if Redis commands take too long to respond.
You notice your app is slow and want to see if Redis is the cause.
You want to track Redis performance over time to avoid surprises.
You want to find which commands cause delays in Redis.
You want to get alerts when Redis latency goes above a limit.
Syntax
Redis
LATENCY LATEST
LATENCY HISTORY <event>
LATENCY DOCTOR
LATENCY GRAPH <event>

LATENCY LATEST shows recent latency spikes.

LATENCY DOCTOR gives simple advice based on latency data.

Examples
Shows the most recent latency spikes recorded by Redis.
Redis
LATENCY LATEST
Shows latency history for the event named 'command'.
Redis
LATENCY HISTORY command
Gives a simple report with suggestions about latency issues.
Redis
LATENCY DOCTOR
Sample Program

This command shows the latest latency spikes for events 'command' and 'fork'. Each event shows the time, max latency, average latency, and latest latency in microseconds.

Redis
127.0.0.1:6379> LATENCY LATEST
1) 1) "command"
   2) (integer) 1680000000
   3) (integer) 120
   4) (integer) 100
   5) (integer) 150
2) 1) "fork"
   2) (integer) 1680000100
   3) (integer) 300
   4) (integer) 250
   5) (integer) 350
OutputSuccess
Important Notes

Latency monitoring commands require Redis 2.8.13 or newer.

Use LATENCY RESET to clear latency data if needed.

Latency values are in microseconds.

Summary

Latency monitoring helps find slow Redis commands.

Use LATENCY LATEST and LATENCY DOCTOR to check delays easily.

Regular checks help keep Redis fast and your app happy.