Top key analysis

Updated at:

Database Autonomy Service (DAS) key analysis identifies large keys (big keys) and hot keys in your Redis instance in real time. By monitoring key access frequency and element counts, this feature helps you prevent insufficient memory and performance degradation caused by skewed key distribution.

Prerequisites

Your instance must be a compatible Redis or Tair instance:

Identification and ranking mechanism

To avoid placing extra load on your database, this feature collects statistics only on keys accessed by client read or write operations. It retains and displays only a specified number of top keys for each type, rather than scanning all keys in the database in real time. Additionally, after an instance restarts or a high availability (HA) switchover occurs, the collected statistics are cleared, and the process begins again. As a result, keys that have not been accessed for a long time may not be included in the statistics. To analyze the memory usage and distribution of all keys in your database, use the Offline Key Analysis feature.

Key type

Applicable versions

Statistical mechanism

Description

Large key (by number of elements)

  • Redis Open-Source Edition 5.0 or later.

  • Tair (Enterprise Edition).

A key is considered a large key if its number of elements, such as fields in a Hash or members in a Set, reaches or exceeds a threshold (default: 2,000). You can customize this threshold by setting the bigkey-threshold parameter.

Note
  • Persistent memory instances do not support the bigkey-threshold parameter.

  • If this parameter is not displayed in the settings, upgrade the minor version of your instance and try again.

Displays up to the top three large keys for each data type. If multiple keys have the same number of elements, the one that was written first is prioritized.

Note
  • For Tair (Enterprise Edition) persistent memory instances, only the top three keys by element count across all key types are displayed.

  • For other instances, if only three large keys are displayed in total, upgrade the minor version and try again.

Large key (by memory usage)

Cloud-native memory-optimized instances of Tair (Enterprise Edition) with minor version 25.6.0.0 or later.

  • A key is considered a large key if its total memory usage exceeds a threshold (default: 500 MB). You can customize this threshold by setting the bigkey-mem-threshold parameter.

  • A key is also considered a large key if the average memory usage of its elements exceeds 1 MB. You can customize this threshold by setting the bigkey-field-mem-threshold parameter. For example, a String key is considered large if its value exceeds 1 MB. A Hash key with 100 key-value pairs is considered large if its total memory usage results in an average element size greater than 1 MB.

  • Effective May 26, 2026, the default value for bigkey-field-mem-threshold is changed from 50 MB to 1 MB.

Displays up to the top three large keys for each data type. If keys have the same memory usage, the one that was written first is prioritized.

Hot key (by QPS)

  • Redis Open-Source Edition 5.0 or later.

  • Tair (Enterprise Edition).

A key is considered a hot key if its queries per second (QPS) exceeds 5,000. You can customize this threshold by setting the hotkey-threshold parameter.

The system displays up to the top 50 hot keys and shows their precise real-time QPS.

Hot key statistics have limited support in earlier minor versions. We recommend that you upgrade to the latest minor version.

In versions earlier than Redis Open-Source Edition 7.0.18, 6.0.2.9, and 5.5.2.9, or memory-optimized Tair 5.0.50 and 25.2.0.0, the QPS threshold for hot keys was fixed at 3,000 and could not be adjusted. Only an approximate QPS range could be displayed, and Redis Open-Source Edition supported statistics for only 20 hot keys.

Hot key (by traffic)

Cloud-native memory-optimized instances of Tair (Enterprise Edition) with minor version 25.2.0.0 or later.

A key is considered a hot key if its access traffic exceeds 1 MB/s.

  • This feature is disabled by default. You can enable it by setting the #no_loose_high-cost-key-enabled parameter to yes.

  • You can adjust the traffic threshold in B/s by setting the #no_loose_high-cost-key-traffic-bytes-threshold parameter.

  • You can use the #no_loose_high-cost-key-parse-hashtag and #no_loose_high-cost-key-parse-prefix parameters to enable statistics for hashtags and prefixes. This allows the system to identify cases where individual keys have low traffic, but the aggregated traffic of keys with the same hashtag or prefix exceeds the threshold. This feature requires an upgrade to minor version 25.9.1.0 or later.

The system displays up to the top 50 hot keys and shows their precise inbound and outbound traffic, as well as access frequency.

Note

Statistics for non-existent keys are supported. If the data type is displayed as not-exist-key, it indicates that the key does not exist but is frequently accessed.

This feature supports the following data structures:

  • Native Redis data structures: String, List, Hash, Set, Zset, and Stream

  • Tair-developed data structures: TairString, TairHash, TairGIS, TairBloom, TairDoc, TairCpc, TairZset, TairRoaring, TairTS, and TairSearch

    Note

    Tair (Enterprise Edition) persistent memory instances support statistics for only TairHash and TairString.

Procedure

  1. Log on to the DAS console.

  2. In the navigation pane on the left, click Intelligent O&M Center > Instance Monitoring .

  3. Click the Redis tab.

  4. Find the target instance and click the instance ID to open the instance details page.

  5. In the navigation pane on the left, click Top Key Statistics.

  6. Click the Real-time or History tab to view the information about hot keys and large keys.

    Note

    On the History tab, you can query large keys and hot keys analyzed within the last four days. The maximum time range between the start time and end time is 3 hours.

References

For more information about how to use this feature in the Tair console, see Top key statistics.

Related API operations

API

Description

DescribeHotBigKeys

Queries hot keys and large keys in memory in real time.

DescribeTopHotKeys

Queries the top 100 hot keys over a specified time period.

DescribeTopBigKeys

Queries the top 100 large keys over a specified time period.

DescribeHotKeys

Queries the hot keys of an instance.