All Products
Search
Document Center

Tair (Redis® OSS-Compatible):Offline key analysis

Last Updated:Oct 21, 2025

You can use offline key analysis to analyze the backup files of Tair (Redis OSS-compatible) instances. This helps you quickly identify large keys and view details such as memory usage, key distribution, and key expiration times. You can use this data to optimize your instance and prevent issues such as insufficient memory or performance degradation caused by key skew.

This feature is provided on top of the cache analysis feature of CloudDBA.

Usage notes

  • This feature is not supported for disk-based instances.

  • If you change the instance type, you cannot analyze backup files that were created before the change.

  • The Offline Key Analysis feature supports only Redis Open-Source Edition data structures and the following proprietary Tair data structures: TairString, TairHash, TairGIS, TairBloom, TairDoc, TairCpc, and TairZset. The analysis task fails if other proprietary Tair data structures exist.

Procedure

  1. Log on to the console and go to the Instances page. In the top navigation bar, select the region in which the instance that you want to manage resides. Then, find the instance and click the instance ID.

  2. In the left-side navigation pane, choose CloudDBA > Offline Key Analysis.

    By default, the analysis results of the previous day are displayed on the Offline Key Analysis tab. You can specify another time range based on your requirements.

  3. On the Offline Key Analysis tab, click Analyze.

  4. In the dialog box that appears, specify the node and analysis method.

    设置分析节点和方式

    Parameter

    Description

    Node

    The ID of the node on which you want to perform cache analysis.

    Note

    You can select the entire instance or a specific node for analysis.

    Analysis Method

    The backup file that is used for analysis.

    • Use Recent Backup File: analyzes the most recent backup file.

    • Select a historical backup file: analyzes a historical backup file.

    • Create New Backup for Analysis: creates a backup file and analyzes the file. This allows you to analyze the current status of the instance.

    Note

    If you analyze an existing backup file, make sure that the point in time when the backup file is generated meets your requirements.

    Delimiter

    The delimiters used to identify prefixes of keys. You do not need to specify the delimiters if you use the following default delimiters: :;,_-+@=|#.

  5. Click OK.

    The system performs analysis and displays the analysis status. You can click Refresh to update the analysis status.

  6. Find the completed analysis task and click Details in the Actions column to view the detailed results.

    • Basic information: displays the basic information of the instance such as the basic attributes and the cache analysis method.基本信息

    • Related node: displays the memory usage and key statistics on each node of the instance.结果1

      Note

      The Related node section is displayed on the Details page only if the instance is a cluster or read/write splitting instance and the entire instance is selected for the preceding Node parameter.

    • Details: displays the details about the instance or node, such as the memory usage and distribution of keys, memory usage and distribution of elements in keys, distribution of key expiration time, and ranking of large keys.缓存分析详情

FAQ

  • Q: What do I do if many expired keys are found?

    A: This may occur if a time-to-live (TTL) is configured for business data and many keys expire at the same time. The instance automatically clears expired data. However, you can also quickly clear expired keys using the Clear Data feature in the console. For more information, see Clear expired keys.

  • Q: What do I do if a "permission denied" error is reported when I use a RAM user?

    A: Grant the required permissions to the RAM user and retry the operation. For more information, see Common scenarios and examples of custom policies.

  • Q: Why does the speed of offline analysis tasks vary for the same instance?

    A: Offline analysis tasks are asynchronous. The analysis speed also depends on the total number of current tasks in CloudDBA. If there are many tasks in the queue, your analysis task must wait, which increases the total analysis time.

  • Q: How do I handle the decode rdbfile error: rdb: unknown object type 116 for key error?

    A: This error indicates that the instance contains non-standard Bloom structures, which are not supported for analysis.

  • Q: How do I handle the decode rdbfile error: rdb: invalid file format error?

    A: This error indicates that the selected backup file is invalid. Check if the instance configuration was changed after the backup was created. Also, check if Transparent Data Encryption (TDE) is enabled. This feature cannot be used to analyze encrypted information.

  • Q: How do I handle the decode rdbfile error: rdb: unknown module type error?

    A: This error indicates that the backup file contains proprietary Tair data structures that are not supported for analysis.

  • Q: What do I do if the XXX backup failed error occurs after I create a new backup and use it for analysis?

    A: A BGSAVE or BGREWRITEAOF command is running on the instance. This causes the backup creation for the cache analysis task to fail. We recommend that you create a new backup during off-peak hours and use that backup file for the analysis. Alternatively, you can use a historical backup file for the analysis.

  • Why is the amount of memory usage of keys that are displayed on the Details page smaller than the actual memory usage of the keys?

    The cache analysis feature calculates the amount of memory that is consumed by keys and their values that are stored in Redis database backup (RDB) files after the keys and the values are serialized. The calculated amount of memory accounts for only part of the used memory space. The used memory also includes the following parts:

    • The amount of memory that is consumed by the struct data, pointers that correspond to the keys and values, and byte alignment. After you use jemalloc to allocate the memory of a database instance, data is aligned based on specific rules. If a database instance contains 250 million keys, the total amount of memory that is consumed by the struct data, pointers, and byte alignment can be approximately 2 GB to 3 GB.

    • The amount of memory that is consumed by the output buffer, query buffer, and append-only file (AOF) rewrite buffer on your clients, and the amount of memory that is consumed by backlogs. The backlogs are generated during primary/secondary replications.

  • What are the delimiters that are used as prefixes to distinguish different types of data during cache analysis?

    DAS uses :;,_-+@=|# as delimiters to distinguish data during cache analysis.

  • Why is the number of elements the same as the length of elements for keys of the String type in cache analysis for a Tair (Redis OSS-compatible) instance?

    In cache analysis for a Tair (Redis OSS-compatible) instance, the number of elements represents the length of elements for keys of the String type.

  • Why is the memory usage of Stream keys that are displayed on the Details page several times greater than the actual memory usage of the keys?

    Stream is a complex data structure that uses radix trees and listpacks under the hood. The cache analysis feature cannot accurately identify the memory usage of such complex data structures, which causes deviations in results.

    Note

    The exhibited deviations are statistical in nature and do not affect the functionality of the database instance.

Related API operations

API operation

Description

CreateCacheAnalysisJob

Creates a cache analysis task.

DescribeCacheAnalysisJob

Queries the information about a cache analysis task.

DescribeCacheAnalysisJobs

Queries a list of cache analysis tasks.