Skip to content

Ask the HotKV docs

Answers come only from these docs and can be wrong; check the linked pages before you rely on them.

LATENCY

Last updated
LATENCY subcommand [argument ...]
Group
Server
Arity
-2 (at least 2 words, counting the command name)
Flags
admin, read-only
HotKV Cloud
All plans
On-Premise
no license needed

LATENCY is a container command for two kinds of latency data:

  • Latency spikes, recorded by the latency monitor once you set latency-monitor-threshold to a number of milliseconds (it is 0, off, by default). Anything that takes at least that long is recorded under an event name: command for a slow command, fast-command for a command that is normally fast, and expire-cycle for a slow round of removing expired keys. Each event keeps its most recent 160 spikes, at most one per second (the worst one in that second).
  • Latency distributions per command, collected all the time while latency-tracking is yes (the default).

LATENCY HELP lists the subcommands.

Subcommand What it does
LATENCY LATEST The latest and worst spike of each event.
LATENCY HISTORY The recorded spikes of one event.
LATENCY GRAPH One event’s spikes as a text chart.
LATENCY DOCTOR A plain-English report on the spikes, with advice.
LATENCY RESET Forget the spikes of some or all events.
LATENCY HISTOGRAM Per-command latency distribution.

An unknown subcommand gets ERR unknown subcommand '<name>'. Try LATENCY HELP.

127.0.0.1:6379> CONFIG SET latency-monitor-threshold 50
OK
127.0.0.1:6379> LATENCY LATEST
1) 1) "command"
2) (integer) 1790000000
3) (integer) 120
4) (integer) 340

Same subcommands and reply shapes as Redis 7 and Valkey 8. HotKV records the command, fast-command and expire-cycle events.

SLOWLOG, INFO (latencystats), monitoring, troubleshooting