Skip to content

Document HOTKEYS hot key detection command (GET/RESET) - #460

Open
alon-arenberg wants to merge 3 commits into
valkey-io:mainfrom
alon-arenberg:hotkey-detection-docs
Open

Document HOTKEYS hot key detection command (GET/RESET)#460
alon-arenberg wants to merge 3 commits into
valkey-io:mainfrom
alon-arenberg:hotkey-detection-docs

Conversation

@alon-arenberg

@alon-arenberg alon-arenberg commented Jul 20, 2026

Copy link
Copy Markdown

Document the HOTKEYS command (server-side hot key detection)

Documentation for the server-side hot key detection feature added in
valkey-io/valkey#3708.

Hot key detection samples client key accesses and maintains an approximate
top-K of the most frequently accessed keys (Space-Saving algorithm) over a
fixed, frozen reporting window, surfaced through a new HOTKEYS container
command.

What's included

Command pages:

  • commands/hotkeys.md — container overview: what hot key detection does,
    that it is disabled by default, and how to enable it (hotkey-top-k set to a
    positive value; 0 disables).
  • commands/hotkeys-get.mdHOTKEYS GET: returns the hottest keys from the
    last completed window ordered by estimated QPS (descending); documents the
    key/db/qps fields and the QPS estimate, the frozen-window semantics
    (empty until the first window completes), the hotkey-top-k cap, and the
    RENAME/MOVE/SWAPDB stale-attribution behavior.
  • commands/hotkeys-reset.mdHOTKEYS RESET: clears the live and frozen
    windows.

Reply metadata:

  • resp2_replies.json / resp3_replies.json — reply descriptions for
    HOTKEYS, HOTKEYS GET, and HOTKEYS RESET. HOTKEYS GET returns an array
    of entries (RESP3: each entry is a map with key, db, qps; RESP2: the
    equivalent flat field/value array), ordered by QPS descending.

Related

Notes

The command metadata (arity, args, flags) is generated from the command JSON in
the main repo, so this PR only adds the human-readable pages and reply
descriptions.

Signed-off-by: Alon Arenberg <alonare@amazon.com>
Signed-off-by: Alon Arenberg <alonare@amazon.com>
Signed-off-by: Alon Arenberg <alonare@amazon.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant