This topic describes how to query large keys in an ApsaraDB for Redis instance.
ApsaraDB for Redis provides complex data types such as lists, hash tables, and sorted sets. When you use the service, improper key design may result in large keys. When you obtain or delete a large key of an instance, your business may be affected due to the single-threading model of ApsaraDB for Redis. If your instance is a cluster instance, the existence of large keys may even cause out-of-memory (OOM) errors for specific nodes.
You can use one of the following methods to query large keys in an ApsaraDB for Redis instance:
View large keys of the instance in the ApsaraDB for Redis console. This has minimal impact on performance. For more information, see Use the real-time key statistics feature. This method is recommended.
Analyze historical backup data to identify large keys and hotkeys. This does not affect online services. For more information, see Use the offline key analysis feature.
View historical large keys recorded in instance audit logs. For more information, see View audit logs.
Query large keys by using API operations:
Description
Queries the hotkeys and large keys in the memory in real time.
Queries the top 20 hotkeys over a period of time.
Queries the top 20 large keys over a period of time.
Queries the hotkeys of an ApsaraDB for Redis instance.