Cluster Hot Slots Heatmap — Technical Design Doc - Part 1 #498
nassery318
started this conversation in
Design
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Addressing: #470
Add cluster slot heatmap visualization
Overview
This document describes the slot-level heatmap now present in the Hot Keys tab of the Activity view, available on clusters that already run the hot-slots collection mode. It adds a per-slot view of where the cluster's hot keys are concentrated — how many of them each slot holds and which node reported it — with a drill-down from any slot to the keys inside it, so a user can go from "these keys are hot" to "this slot, on this node, holds most of them" without leaving the screen.
Motivation
Hot keys were presented as one flat, cluster-wide ranked list. The list identifies what is hot but not where the heat is concentrated, and the slot is the unit an operator can actually act on — resharding, slot migration, and hash-tag redesign all operate on slots. This made two common diagnostic tasks slow:
The slot each key came from was already known during collection and discarded before it reached the UI. Recovering it is what this change does.
Goal
The goal of the hot slots heatmap is to:
Current State Before This Change
The Hot Keys tab collects data two ways. The default samples
MONITORoutput. The second, used when a node runs an LFU eviction policy withcluster-slot-stats-enabled, asks Valkey which slots are consuming CPU (CLUSTER SLOT-STATS ORDERBY CPU-USEC), scans the keys within each returned slot, and ranks them by access frequency.The second path is inherently slot-scoped, but the slot each key came from was dropped before the response left the collector. Every key was folded into one cluster-wide top-N list. A node heatmap sat alongside the list and answered "which node," leaving nothing between the node and the individual key.
Implemented Design
The Slot Heatmap is a second tab inside the existing node heatmap modal, reached from the Hot Keys toolbar button now labelled simply Heatmap. The tab appears only in cluster mode with hot-slots collection active and at least one returned key carrying a slot, since
CLUSTER SLOT-STATShas no standalone equivalent.[key, freq, slotId]instead of[key, freq]. The enrichment step passes the slot through untouched while adding size and TTL.Slot Data Used
Metric used to classify slots
Fields shown as reported
cpu-usec, keys scanned, and summed frequency are not carried to the UI. Summed frequency is computed in the browser but used only to break ties when ordering tiles.UI Component Breakdown
Summary chips
A row above the grid carrying the totals: hot slots in the sample, hot keys across them, and nodes represented. Where one or more nodes failed to report, a fourth item states how many, so a shrunken total is never presented as complete.
Slot tile and drill-down
Each tile shows its slot ID and hot key count, coloured by concentration and sized uniformly. Tiles are ordered by hot key count, then by summed frequency. Hovering reveals the slot ID, its share of the top-N, and the reporting node. Selecting a tile opens that slot's key list beside the grid, under a header repeating the same share, with size and TTL per key and the owning node in the footer. Clicking a key closes the modal and selects that key in the key browser, completing the path from cluster-wide concentration down to a single key. A line beneath the grid states that it shows the slots holding the top-N hot keys, not every slot in the cluster.
Slot Intensity Classification
Each slot is shaded across five intensity bands. The grid is the primary scanning aid — with dozens of slots in the sample, it must let a user find the few that matter without reading every tile. Intensity is driven by hot key count, normalized against the range present in the returned set, and the legend doubles as a multi-select filter: selecting one or more bands dims every slot outside them. The colour ramp, the band snapping, and the legend are shared with the node heatmap.
Edge Cases
All reactions