How Do I Detect Big Keys and Hot Keys in Advance?
Method |
Description |
---|---|
Through Big Key Analysis and Hot Key Analysis on the DCS console |
|
By using the bigkeys and hotkeys options on redis-cli |
|
Searching for big keys using Redis commands |
If there is a pattern of big keys, for example, the prefix is cloud:msg:test, you can use a program to scan for keys that match the prefix, and then run commands to query the number of members in the key and query the key sizes to find big keys.
CAUTION:
This method consumes a large number of computing resources. To ensure service running, do not use this method on instances with heavy service pressure. |
Searching for big keys using redis-rdb-tools |
redis-rdb-tools is an open-source tool for analyzing Redis RDB snapshot files. You can use it to analyze the memory usage of all keys in a Redis instance. To use this method, you must export the RDB file of an instance on the Backups & Restorations page of the DCS console.
CAUTION:
This method does not affect service running, but is not as timely as online analysis. |
Hot key analysis is not supported by DCS Redis 3.0 instances. However, you can configure alarms to detect hot keys.
- Configure alarm rules for the Memory Usage metric of the instance nodes.
If a node has a big key, the memory usage of the node is much higher than that of other nodes. In this case, an alarm is triggered to help you find the potentially problematic key.
- Configure alarm rules for the Maximum Inbound Bandwidth, Maximum Outbound Bandwidth, and CPU Usage metrics of the instance nodes.
If a node has a hot key, the bandwidth and CPU usage of the node is much higher than that of other nodes. In this case, an alarm is triggered to help you find the potentially problematic key.
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot