Database Autonomy Service (DAS) provides the key analysis feature. This feature allows you to view the information of hot keys and large keys in your database instance, such as the memory that is used by keys, the distribution of keys in the memory, and the expiration time of each key. This way, 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.
PrerequisitesYour 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 performance-enhanced instance of ApsaraDB for Redis Enhanced Edition (Tair). For information about performance-enhanced instances, see DRAM-based instances.
- The instance is updated to the latest minor version. For more information, see Update the minor version.
|large key||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. |
|hotkey||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. |
- 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. Note On 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.