...

Identifying Redis Hot Keys and Targeting Cache Bottlenecks

You can identify Redis hot keys by narrowing down conspicuous nodes and load windows and then examining the resource usage of individual keys. CPU Time and Network Bytes help distinguish between different types of bottlenecks: A small value that is read frequently can cause just as many problems as an expensive collection operation or a large response. Starting with version 8.6, Redis Open Source offers the command group HOTKEYS. However, their rankings provide candidates rather than exact traffic figures; the version, measurement window, and nodes determine the reliability of the data.

What makes a Redis key "hot"?

A Hot Key is a key that generates a particularly high load compared to other entries. This could be a small, rarely updated product record that is read by a large number of queries simultaneously. It is not only the size of the value but also the access pattern that determines how much load is placed on Redis.

Load is generated in various ways: Many small read operations place a burden on the server due to their frequency. A resource-intensive operation on a collection, on the other hand, can consume a lot of CPU time, even though it is performed less frequently. If a key repeatedly returns large responses, the network in particular can become the bottleneck.

A Big Key Therefore, it is not automatically a hot key. A large entry that is rarely accessed can take up a lot of memory without placing an excessive load on ongoing processing. Conversely, a small value requires little memory but can still cause a significant amount of work due to frequent accesses. Size and load diagnostics answer various questions.

Even a noticeable shard does not necessarily indicate a single "hot" key. In a Redis cluster, a key is assigned to a shard; if requests are concentrated on that shard, that node may be under particularly heavy load. However, the same symptom can also be caused by many keys with varying usage patterns or resource-intensive commands. The shard metric initially shows you where you should look more closely.

Narrow Down Load and Topology

Start by looking at the application's symptoms: When do response times increase, and when do timeouts occur? Compare these time periods with the available CPU and network metrics for the Redis nodes. It’s particularly helpful to map these issues to individual shards, because a cluster as a whole may appear to be functioning normally while a single node is under heavy load.

Suppose that, during a sales promotion, both the application latency and the CPU load of a shard increase at the same time. This is a useful Correlation: It narrows down the investigation period and the node. However, it does not prove that exactly one key is responsible, nor that Redis alone is causing the delay. Other activity on the node or delays outside of Redis are also possible hypotheses.

Before making a diagnosis, determine whether the problem is persistent or occurs only during certain peaks. Compare a typical load window with the period when the anomaly occurred, and note which nodes are involved. An analysis conducted during a quiet phase may overlook a temporary spike; conversely, a peak reading cannot be readily extrapolated to normal operation.

Also verify the actual product being used, its version, and the topology: single instance, cluster, or managed service. Check which diagnostic commands the ACL permits and whether operational approval has been granted. Permission alone does not constitute approval for additional diagnostic work on a server that is already under load.

What HOTKEYS Actually Records

Redis Open Source introduced the command group HOTKEYS with version 8.6.0. Therefore, you should not assume it is available on older installations. For managed services and Redis-compatible products, check separately which version or product is running and whether the commands are actually available there and enabled for your use.

The assessment evaluates candidates based on CPU Time and Network Bytes. For each selected metric, a limited Top-K list is generated. One entry may stand out in the CPU list due to intensive processing, while another may appear in the network list because of large or frequent responses. Which resource you examine therefore influences the interpretation.

These rankings are not exact counts of all hits per key, nor are they a direct list of requests per second. The tracking uses a probabilistic data structure; furthermore, the chosen list size limits which candidates are displayed. Rankings and estimated contributions should therefore be viewed as pointers for further investigation, not as a complete tally.

With Sampling This can reduce the effort required for data collection, but relevant keys may be overlooked in the process. Therefore, for each result, always note the observation window, the selected metrics, the sampling settings, and the node under examination. A missing candidate in a short or sampled observation is not, in and of itself, a reason to rule out the issue.

Using and Analyzing HOTKEYS Safely

Select one of the following for data entry: Measurement Window, which matches the suspected problem. You can examine a known load peak and a quiet phase separately; a short period outside the peak might cause you to overlook a key that only gets hot occasionally. Coordinate the diagnosis in advance: Starting the system changes the diagnostic state and can create additional load.

The following example has not been executed. It is intended for the Redis CLI in a shared test environment running Redis Open Source version 8.6 or later, with the required ACL permissions. Start the collection on the node you want to examine and retrieve the results during or after the time window:

Code
HOTKEYS START METRICS 2 CPU NET COUNT 10 DURATION 60 SAMPLE 10
HOTKEYS GET

METRICS 2 CPU NET Selects two metrics: CPU time and network bytes. COUNT 10 limits the size of the top-K collection, DURATION 60 It automatically ends it after 60 seconds. SAMPLE 10 Reduces the effort required for data entry, but may overlook some candidates. The values are provided as an example and do not constitute a general production recommendation.

Before restarting, check to see if a session is already running: it may prevent you from starting another one. With HOTKEYS STOP You can stop an ongoing recording without deleting its data. Review and discuss the results before you continue with HOTKEYS RESET you release the resources; after that, the results will no longer be available.

The results apply to the server or node being examined, not automatically to the entire cluster. In the cluster, the option SLOTS Limit the capture to selected hash slots; outside of cluster mode, this will result in an error. Therefore, record the nodes and, if applicable, the slot selection along with the result.

A Comparison of Diagnostic Tools

These tools address different issues. A large data size is just as little an indication of an access ranking as a single slow command. Therefore, first decide whether you are looking for resource consumption per key, slow operations, or indications of large data structures.

Redis Diagnostic Tools and Their Limitations
ToolPrerequisiteStatementRestrictionOperational Risk
HOTKEYSSupported Product and ReleaseTop K Candidates by CPU and/or NetworkProbabilistic; node-basedDiagnostic Status and Additional Effort
redis-cli –hotkeysAppropriate LFU Eviction PolicyNotes on Frequently Used KeysApproximate frequency; no exact time frameScans put a strain on the server; policy changes affect eviction
SLOWLOG GETSlow Log and Access PermissionsCommands above the configured execution thresholdNo full client latency or response transmissionIssues may contain sensitive data
MONITORApproval and Data Protection PolicyCurrent Command ActivityNo predefined hotkey rankingMay affect latency and disclose command data
–bigkeys / –memkeysAppropriate CLI and scan sharingSize and Storage InformationNo frequency rankingScanning creates additional server load

For redis-cli --hotkeys is a suitable LFU Eviction Policy Prerequisite. Do not change this setting just for the sake of a short-term diagnosis: It helps determine which entries Redis evicts when storage is scarce. Furthermore, the approximate LFU information is no substitute for an exact count over a freely chosen measurement window.

The Slow Log is helpful for expensive individual operations, but it does not track either the total client-to-server latency or the transmission of the response. Many individually fast accesses can overload a key without being noticeable there. Treat logged arguments and client information according to their potential sensitivity.

Warning: Set MONITOR Do not use this as a routine diagnostic tool on a heavily loaded production server. If necessary, limit its use to specific time periods after approval and clarify how disclosed data will be handled. Incremental SCAN creates jobs; a thoughtless, productive KEYS-Scan is not a safe shortcut.

Interpreting CPU and Network Metrics

Suppose a key appears in the CPU Rankings. First, investigate which commands access its data structure and whether individual collection operations are causing a lot of work. The ranking identifies a potential cause of resource consumption, but it does not provide an exact number of accesses or the cause of the application latency.

If you find slow individual commands related to this candidate in the slow log, that’s an additional clue to the application path. If the log remains empty, this does not rule out the key: many fast commands can collectively be relevant. Therefore, you should also examine the access pattern rather than just looking for individual instances where thresholds are exceeded.

Another hypothetical key stands out above all for Network Bytes . Here, it's worth asking how large the responses are and whether the calling application path needs the full value. A smaller data model or retrieving only the necessary parts may be more appropriate than simply searching for CPU-intensive commands.

AI-generated illustration of two distinct groups of shapes representing CPU activity and network traffic
AI-generated illustration: CPU time and network bytes highlight different types of load.

For both cases, document the time period, nodes, selected metrics, and sampling along with the candidates. Compare the results with application latency and node metrics in the same window. A ranking for a single node does not constitute a complete cluster analysis; a missing candidate may also be due to the sampling or the selected time period.

Mitigating Read Load and Cache Misses

If product data that is rarely updated is read on nearly every page view, a single Redis key can generate a significant read load despite having a small value. A client-side cache also stores frequently needed responses in the application's memory. If there is a local hit, the application does not need to query Redis again for that value; the effect depends on how often the same value is reused within a process.

To do this, check whether your client supports the Redis protocol for client-side caching and handles invalidations. Limit the local storage and define how the application behaves after connection failures so that cached values do not remain stale indefinitely. If product data changes frequently, repeated invalidations can reduce the benefit; additionally, each application process has its own cache.

AI-generated stock image of two notebooks and blank index cards, symbolizing a local cache copy
AI-generated stock image: A local cache stores frequently used data close to the application.

Another problem arises when a popular entry expires and many requests simultaneously access a Cache Miss trigger. This can cause multiple processes to recalculate the same value in parallel, putting a strain on the backend. A hot-key ranking alone does not prove this sequence of events: Compare misses, the time the event occurred, and the backend load before assuming that the recalculation is the cause.

If the hypothesis is confirmed, a coordinated recalculation can prevent each request from triggering the same process. Determine how waiting requests are handled and what happens if a calculation process fails. In addition, a suitable workflow concept is helpful; the Redis Expire Strategies for Large Cache Systems explain the relationship between expiration times and invalidation.

Distribute Write Load and Data Volume

A shared counter has different requirements than frequently read product data: A local read cache does not relieve the Redis node of write operations. Possible changes to the data model include Subtotal, to which writing processes distribute their updates. The total value is then calculated by aggregating the partial values, rather than updating the same key with every change.

This distribution changes the technical characteristics. If a reader queries sub-counters one after another, additional write operations may occur between queries; the sum is then not necessarily a snapshot. Therefore, decide in advance how up-to-date and consistent the total value must be, and whether the additional read and aggregation overhead is acceptable for your use case.

Within the cluster, the partial keys must actually be distributed across appropriate slots and thus across the designated shards. Verify the mapping rather than assuming an even distribution based on different key names. Having more shards alone does not automatically distribute the work on a single, unmodified key; the access patterns of the writers must also match the subkeys.

If, on the other hand, the network ranking shows a conspicuous key, first examine the Response size and the actual data requirements. Does the application need to transfer the entire object every time it is accessed, or would individual fields or a smaller representation suffice? A customized data model can reduce the number of bytes transferred, but may also entail additional keys, queries, and update logic.

Also check whether smaller responses still provide the same technical information and how related data is updated. The appropriate solution depends on whether network traffic, write load, or expensive commands are causing the bottleneck. Partial counters and smaller responses solve different problems and should not be implemented solely because of a high ranking.

Review Measures and Ensure Operational Stability

Before making a change, note which hypothesis you are testing: for example, fewer Redis read operations due to a local cache, or smaller responses due to a different data model. Then choose a comparable load window and monitor application latency as well as the CPU and network activity of the affected node. Also compare the data traffic or request volume to ensure that a quieter period is not mistakenly interpreted as success.

Perform a new diagnostic test only with approved authorization and, if possible, using comparable settings. Document the nodes, time period, metrics, and sampling along with the results. A change in the Top-K order may be an indication of a change, but due to probabilistic sampling and limited lists, it does not provide exact proof of changes in individual access counts.

Empty results are not a cause for relief: The relevant peak may have been outside the window, the wrong node may have been examined, or sampling may have overlooked a candidate. Check these possibilities against the original symptoms. If timeouts or one-sided node load persist, investigate other causes as well, rather than interpreting the absence of a hot key as evidence of healthy operation.

Treat diagnostic output as potentially sensitive operational data. Keys, command arguments, and client information may reveal details about users or internal processes; restrict access, sharing, and retention accordingly. This applies particularly to slow-log output and any brief monitoring that may have been authorized with MONITOR, which can also affect latency.

Make sure you have the results you need before voting HOTKEYS RESET use to release the diagnostic resources: After that, these results will no longer be available. As supplementary event signals, you can Redis Keyspace Notifications such as highlighting changes or processes. However, they do not replace a resource-based hotkey ranking and should be used in a way that aligns with the observation objective.

Sources and Current State of Knowledge

Status of the research:

Research status: November 16, 2026. HOTKEYS was introduced in Redis Open Source 8.6.0; check availability and release status separately for managed or compatible products.

https://redis.io/docs/latest/operate/oss_and_stack/stack-with-enterprise/release-notes/redisce/redisos-8.6-release-notes/

https://redis.io/docs/latest/commands/hotkeys/

https://redis.io/tutorials/redis-software-observability-playbook/

https://redis.io/docs/latest/management/optimization/latency/

https://redis.io/docs/latest/commands/hotkeys-start//

https://redis.io/docs/latest/commands/slowlog-get/

https://redis.io/faq/doc/1mebipyp1e/what-is-the-redis-latency-or-timeouts-with-redis

https://redis.io/docs/latest/operate/rs/databases/connect/troubleshooting-guide/

https://redis.io/docs/latest/manual/client-side-caching/

Current articles

AI-generated illustration of numerous access paths to a single data structure, symbolizing a Redis hot key
Databases

Identifying Redis Hot Keys and Targeting Cache Bottlenecks

Redis hot keys can put a strain on individual nodes due to frequent accesses, expensive commands, or large responses. Learn how to narrow down the candidates and choose the appropriate countermeasures.