Database Autonomy Service (DAS) provides the key analysis feature. This feature allows you to view the large keys and hot keys in your database instance in real time. You can also view the large keys and hot keys that are detected in the last four days. This allows you to obtain data such as the key access frequency and the number of elements. You can optimize database performance based on the obtained data. This feature also helps you prevent issues caused by unbalanced distribution of keys in the memory, such as insufficient memory and reduced performance.
Prerequisites
Your database instance is an ApsaraDB for Redis instance that meets the following requirements:
The instance is an instance of ApsaraDB for Redis Community Edition whose major version is 5.0 or later or a DRAM-based instance of ApsaraDB for Redis Enhanced Edition (Tair). For information about DRAM-based instances, see DRAM-based instances.
The minor version of the instance is the latest. For more information, see Update the minor version of an instance.
Definitions
Key type | Definition |
Large keys | ApsaraDB for Redis sorts list, hash, set, and zset keys based on the number of elements in these keys. ApsaraDB for Redis considers the top three keys that have the most elements as large keys. If two keys have the same number of elements, the key that first reaches this number ranks higher. Note
|
Hotkeys | ApsaraDB for Redis uses efficient sorting and statistical algorithms based on the Least Recently Used (LRU) key eviction policy to identify hotkeys in an instance. Note
|
Procedure
Log on to the DAS console.
- In the left-side navigation pane, click Instance Monitoring.
- Find the database instance that you want to manage and click the instance ID. The instance details page appears.
In the left-side navigation pane, click Key Analysis.
Click the Real-time or History tab to view the information displayed in the Hot Key and Big Key sections.
NoteOn the History tab, you can query the information of large keys and hot keys that are detected in the last four days. The maximum interval between the start time and the end time is 3 hours.
References
For more information about how to use the key analysis feature in the ApsaraDB for Redis console, see Use the real-time key statistics feature.
Related operations
Operation | Description |
Queries the hot keys and large keys in the memory in real time. | |
Queries the top 100 hot keys over a period of time. | |
Queries the top 100 large keys over a period of time. | |
Queries the hot keys of an ApsaraDB for Redis instance. |