Database Autonomy Service (DAS) uses cache analysis to scan Redis backup files and quickly identify large keys. This analysis helps you understand key distribution, memory usage, and expiration details to optimize performance and prevent out-of-memory errors caused by key skew.
Features
The cache analysis feature supports both memory-based and disk-based instances: memory-based instances are analyzed through RDB persistence snapshots, while disk-based instances are analyzed through engine-native scan statistics.
Limitations
The target database instance must be connected to DAS and its status must be Normal Access.
Only Redis data structures and the following Tair self-developed data structures are supported for analysis: TairString, TairHash, TairGIS, TairBloom, TairDoc, TairCpc, and TairZset.
If the instance specification has been changed, you cannot analyze any backup file created before the change.
Procedure
Log on to the DAS console.
In the navigation pane on the left, click .
Find the target instance and click the instance ID to open the instance details page.
In the left-side navigation pane, choose Request Analysis > Cache Analysis.
On the Cache Analysis page, click Analyze in the upper-right corner.

In the Cache Analysis dialog box, configure the following parameters.
Parameter
Description
Node
Select the node ID to analyze.
NoteYou can choose to analyze an entire instance or a specific node.
Analysis Method
Select a backup file for the analysis based on your needs:
Use Recent Backup File: Analyzes the most recent backup file.
Create New Backup for Analysis: Creates and analyzes a new backup to reflect the instance's current state.
Select a historical backup file: Select and analyze a historical backup file.
NoteWhen analyzing an existing backup file, confirm that its timestamp meets your expectations.
Delimiter
Enter the delimiters used to identify key prefixes. You do not need to enter anything if you use the default delimiters:
:;,_-+@=|#.Click OK.
Find the completed analysis task in the Cache Analysis list. In the Actions column, click Details to view the following analysis results:
Basic Information: Provides basic properties of the target instance and the analysis method used.
Relevant Nodes: Displays the memory status and key statistics for each node in a Redis Community Edition cluster. The Relevant nodes area displays the Node ID, Memory Usage (Byte), and Key Count for each node in a table.
NoteThis information is displayed only when you analyze an entire Redis Community Edition cluster instance.
Details: Provides a breakdown of the instance's memory usage, including metrics such as Daily Growth within Seven Days, Total Number of Keys, Memory Usage of Keys, Distribution of Keys, Memory Usage of Elements, Distribution of Elements, Distribution of Key Expiration Time (Memory), and Distribution of Key Expiration Time (Quantity). This section also lists the top 100 large keys ranked by memory usage, total count, and key prefix.
FAQ
Q: Why is the Memory Usage of Keys shown in the cache analysis results smaller than the actual memory usage?
A: The cache analysis parses only the serialized size of keys and values in the RDB file, which accounts for only a portion of the
used_memory. Theused_memorymetric also includes the following components, which are not calculated in the analysis:The overhead from data structures and pointers for keys and values. The analysis also excludes memory overhead from jemalloc byte alignment. For example, for 250 million keys, this overhead can account for 2 GB to 3 GB.
Client output buffers, query buffers, the AOF rewrite buffer, and the replication backlog.
Q: What are the key prefix delimiters for Redis cache analysis?
A: The default delimiters are
:;,_-+@=|#.Q: For String type keys in Redis cache analysis, why are the element count and element length the same?
A: For a String type key, the element count is the same as its length.
Q: How do I handle the error
decode rdbfile error: rdb: unknown object type 116 for key XX?A: This error indicates that a non-standard Bloom structure exists in the Redis instance. You can either delete the keys with the Bloom structure or upgrade the Redis instance to Tair (Enterprise Edition) and change the non-standard Bloom structure to a TairBloom structure.
Q: How do I handle the error
decode rdbfile error: rdb: invalid file format?A: This error indicates that the selected backup file is invalid. Check whether the instance specification was changed after the backup was created. Also, check whether transparent data encryption (TDE) is enabled, as encrypted information cannot be analyzed.
Q: How do I handle the error
decode rdbfile error: rdb: unknown module type?A: This error indicates that the backup file contains a self-developed data structure that is not supported for analysis.
Q: How do I handle the error
XXX backup failedafter selecting "Create New Backup for Analysis"?A: A BGSAVE or BGREWRITEAOF command is currently running on the instance, which caused the backup for the cache analysis task to fail. Either create a new backup for analysis during off-peak hours or select a historical backup file for analysis.
Q: Why are the cache analysis results for Stream data structures several times larger than the actual values?
A: The cache analysis feature provides only an estimate for the complex Stream data structure, which uses a radix tree and listpack. This estimation can lead to deviations in the analysis results.
NoteThis deviation in the analysis results is purely statistical and does not affect the functionality of the database instance.
Related documentation
For information on using the cache analysis feature in the Redis console, see Offline key analysis.
API reference
API | Description |
Creates a cache analysis task. | |
Queries the details of a cache analysis task. | |
Queries a list of cache analysis tasks. |