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
The instance is an ApsaraDB for Redis Community Edition instance that runs Redis 5.0 or later or an ApsaraDB for Redis Enhanced Edition (Tair) DRAM-based or persistent memory-optimized instance.
Statistical ranking mechanisms for large keys and hotkeys
Key type | Statistical ranking mechanism |
Large keys |
Note Keys that have not been accessed for a long period of time may not be included in the statistical ranking. You can use the offline key analysis feature to obtain information about large keys, such as the memory usage of keys, the distribution of keys, the memory usage and distribution of elements in keys, and the distribution of time-to-live (TTL) values across keys. For more information, see Cache analysis. |
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 For Redis Community Edition instances of version 7.0.18, 6.0.2.9, or 5.5.2.9 or Tair DRAM-based instances of version 5.0.50 and later, the following enhancements to hotkeys are made:
|
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 analyzed within 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. |