Repository navigation
Add server-side hot key detection #3708
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. Weโll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
ranshid
merged 24 commits into
valkey-io:unstable
from
alon-arenberg:hot-key-detection-mg
Sep 1, 2026
Merged
Changes from all commits
Commits
Show all changes
24 commits
Select commit
Hold shift + click to select a range
a0618c8
Add server-side hot key detection using the Space-Saving algorithm
alon-arenberg 3dad84f
Merge branch 'unstable' into hot-key-detection-mg
alon-arenberg d3094f9
hotkey: raise hotkey-window-seconds upper limit to INT_MAX
alon-arenberg c4b825e
Merge branch 'unstable' into hot-key-detection-mg
alon-arenberg f163184
fix formatting
alon-arenberg 694e3a5
Merge remote-tracking branch 'origin/unstable' into hot-key-detection-mg
alon-arenberg 29016a6
hotkey: address round-2 review feedback
alon-arenberg 2dbbe3e
hotkey: add serverCron rotation and an explicit enable switch
alon-arenberg 287b241
Merge remote-tracking branch 'origin/unstable' into hot-key-detection-mg
alon-arenberg c262523
hotkey: align spaceSavingManager comments (clang-format)
alon-arenberg 6370a09
Merge remote-tracking branch 'origin/unstable' into hot-key-detection-mg
alon-arenberg fcc4ee3
hotkey: make the Space-Saving API concrete, add unit tests, and derivโฆ
alon-arenberg bd503f3
hotkey: fix comment spacing in getNodeByQuery (clang-format)
alon-arenberg b21ca1a
reorder documentation
alon-arenberg 2dffc68
hotkey: derive QPS from the window's measured duration
alon-arenberg 1f67cd2
Merge branch 'unstable' into hot-key-detection-mg
alon-arenberg 0b103b0
Merge branch 'unstable' into hot-key-detection-mg
alon-arenberg 56a8581
hotkey: one window clock, and an explicit staleness cutoff on rotate
alon-arenberg e6c8080
Merge remote-tracking branch 'upstream/unstable' into hot-key-detectiโฆ
alon-arenberg 77bed78
hotkeys: spell the feature HOTKEYS everywhere, add HELP, and move recโฆ
alon-arenberg e642484
hotkeys: rename the INFO section and its fields to the hotkeys spelling
alon-arenberg 74d2aaf
hotkeys: rename the internal symbols to the hotkeys prefix
alon-arenberg 5b57753
hotkeys: re-align the LOOKUP_* comment block (clang-format)
alon-arenberg 0b0f9af
hotkeys: own the INFO section fields, and rotate from databasesCron
alon-arenberg File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,43 @@ | ||
| { | ||
| "GET": { | ||
| "summary": "Get the hottest keys from the last completed window, ordered by estimated QPS descending", | ||
| "complexity": "O(N) where N is the number of hot keys in the history", | ||
| "group": "server", | ||
| "since": "9.2.0", | ||
| "arity": 2, | ||
| "function": "hotkeysGetCommand", | ||
| "command_flags": [ | ||
| "ADMIN", | ||
| "LOADING", | ||
| "STALE" | ||
| ], | ||
| "acl_categories": [ | ||
| "ADMIN", | ||
| "DANGEROUS", | ||
| "SLOW" | ||
| ], | ||
| "container": "HOTKEYS", | ||
| "reply_schema": { | ||
| "description": "Hottest keys from the last completed window, ordered by estimated QPS (descending)", | ||
| "type": "array", | ||
| "items": { | ||
| "type": "object", | ||
| "additionalProperties": false, | ||
| "properties": { | ||
| "key": { | ||
| "description": "Key name", | ||
| "type": "string" | ||
| }, | ||
| "db": { | ||
| "description": "Database id", | ||
| "type": "integer" | ||
| }, | ||
| "qps": { | ||
| "description": "Estimated accesses per second over the last completed window", | ||
| "type": "integer" | ||
| } | ||
| } | ||
| } | ||
| } | ||
| } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,25 @@ | ||
| { | ||
| "HELP": { | ||
| "summary": "Shows helpful text about the different subcommands", | ||
| "complexity": "O(1)", | ||
| "group": "server", | ||
| "since": "9.2.0", | ||
| "arity": 2, | ||
| "container": "HOTKEYS", | ||
| "function": "hotkeysHelpCommand", | ||
| "command_flags": [ | ||
| "LOADING", | ||
| "STALE" | ||
| ], | ||
| "reply_schema": { | ||
| "type": "array", | ||
| "description": "Helpful text about subcommands.", | ||
| "items": { | ||
| "type": "string" | ||
| } | ||
| }, | ||
| "acl_categories": [ | ||
| "SLOW" | ||
| ] | ||
| } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,24 @@ | ||
| { | ||
| "RESET": { | ||
| "summary": "Reset all hot key statistics and history", | ||
| "complexity": "O(N) where N is the number of keys to remove from history and statistics", | ||
| "group": "server", | ||
| "since": "9.2.0", | ||
| "arity": 2, | ||
| "function": "hotkeysResetCommand", | ||
| "command_flags": [ | ||
| "ADMIN", | ||
| "LOADING", | ||
| "STALE" | ||
| ], | ||
| "acl_categories": [ | ||
| "ADMIN", | ||
| "DANGEROUS", | ||
| "SLOW" | ||
| ], | ||
| "container": "HOTKEYS", | ||
| "reply_schema": { | ||
| "const": "OK" | ||
| } | ||
| } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,12 @@ | ||
| { | ||
| "HOTKEYS": { | ||
| "summary": "A container for hot key commands", | ||
| "complexity": "Depends on subcommand.", | ||
| "group": "server", | ||
| "since": "9.2.0", | ||
| "arity": -2, | ||
| "acl_categories": [ | ||
| "SLOW" | ||
| ] | ||
| } | ||
| } | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.