content/commands/hotkeys-start.md
Starts hotkeys tracking with specified metrics.
This command initiates a hotkey tracking session. You must specify which metrics to track using the required METRICS parameter.
An error is returned if a tracking session is already in progress.
The tracking session continues until manually stopped with [HOTKEYS STOP]({{< relref "/commands/hotkeys-stop" >}}) or automatically stopped after the specified duration.
Required. Specifies which metrics to track and how many hotkeys to track.
count - The number of metrics to collect (required).CPU - Track hotkeys by CPU time percentage (optional).NET - Track hotkeys by network bytes percentage (optional).At least one of CPU or NET must be specified.
Specifies the value of K for the top-K hotkeys tracking.
</details> <details open><summary><code>DURATION</code></summary>The duration in seconds for how long the hotkeys tracking should run. After this time period, tracking will automatically stop. If not specified, tracking continues until manually stopped with HOTKEYS STOP.
Sampling ratio for probabilistic tracking. Each key is sampled with probability 1/ratio. Higher values reduce performance impact but may miss some hotkeys. Lower values provide more accurate results but with higher performance cost.
Specifies which hash slots to track in a cluster environment. Takes a count followed by that many slot numbers. Only keys that hash to the specified slots will be tracked. Useful for tracking hotkeys on specific shards in a Redis cluster. Using SLOTS when not in cluster mode will result in an error.
| Redis Software | Redis Cloud | <span style="min-width: 9em; display: table-cell">Notes</span> | |:----------------------|:-----------------|:------| | <span title="Not supported">❌ Standard</span> <span title="Not supported"><nobr>❌ Active-Active</nobr></span> | <span title="Not supported">❌ Standard</span> <span title="Not supported"><nobr>❌ Active-Active</nobr></span> | |
{{< multitabs id="return-info" tab1="RESP2" tab2="RESP3" >}}
One of the following:
OK when tracking is successfully started.-tab-sep-
One of the following:
OK when tracking is successfully started.{{< /multitabs >}}