Top key analysis
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:
Redis: open-source compatible, version 5.0 or later.
Tair (Redis Enterprise Edition): memory-optimized or persistent memory 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) |
| 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 Note
| 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
|
Large key (by memory usage) | Cloud-native memory-optimized instances of Tair (Enterprise Edition) with minor version 25.6.0.0 or later. |
| 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) |
| A key is considered a hot key if its queries per second (QPS) exceeds 5,000. You can customize this threshold by setting the | The system displays up to the top 50 hot keys and shows their precise real-time QPS. |
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.
| 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. |
Procedure
Log on to the DAS console.
In the navigation pane on the left, click .
Click the Redis tab.
Find the target instance and click the instance ID to open the instance details page.
In the navigation pane on the left, click Top Key Statistics.
Click the Real-time or History tab to view the information about hot keys and large keys.
NoteOn 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 |
Queries hot keys and large keys in memory in real time. | |
Queries the top 100 hot keys over a specified time period. | |
Queries the top 100 large keys over a specified time period. | |
Queries the hot keys of an instance. |