All Products
Search
Document Center

Tair:Use the offline key analysis feature

Last Updated:Mar 22, 2024

The offline key analysis feature enables you to analyze backup files of Tair instances to identify large keys. This feature allows you to view the information about an instance, such as the memory usage, distribution, and expiration time of keys in the instance. You can optimize the instance based on the analysis results. This feature helps you resolve issues such as insufficient memory and performance degradation that are caused by skewed distribution of keys.

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

Usage notes

  • The offline key analysis feature is unavailable for ESSD-based instances.

  • If the instance type of an instance has been changed, backup files that are generated before the change cannot be analyzed.

  • Offline Key Analysis is supported only for Redis data structures and the following in-house data structures of Tair: TairString, TairHash, TairGIS, TairBloom, TairDoc, TairCpc, and TairZset. If you perform offline key analysis on a Tair instance that uses other in-house Tair data structures, the analysis task may fail.

Procedure

  1. Log on to the Tair 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

  • What do I do if an error occurs when I analyze keys as a Resource Access Management (RAM) user that does not have the required permissions?

    Grant the required permissions to the RAM user and try again. For more information, see Tair custom policies.

  • Some offline key analysis tasks take a longer period of time than other tasks. Why?

    As asynchronous tasks, offline key analysis tasks have their time consumption associated with the total number of ongoing tasks in CloudDBA. If a larger than expected number of tasks are waiting in the queue, offline key analysis tasks also need to wait.

  • What do I do if the decode rdbfile error: rdb: unknown object type 116 for key error occurs?

    The backup file cannot be analyzed because the file contains non-standard Bloom filters. Check whether the file contains non-standard Bloom filters.

  • What do I do if the decode rdbfile error: rdb: invalid file format error occurs?

    The backup file that is selected for analysis is invalid. Check whether a configuration change has been made to the instance after the file is generated.

  • What do I do if the decode rdbfile error: rdb: unknown module type error occurs?

    The backup file cannot be analyzed because the file contains incompatible data structures of Tair. Check whether the file contains incompatible data structures.

  • When I create a cache analysis task for an instance, I set the Analysis Method parameter to Create New Backup for Analysis. What do I do if the XXX backup failed error occurs?

    A BGSAVE or BGREWRITEAOF command is being run on the instance. Therefore, the backup file that is used for the cache analysis task cannot be created. We recommend that you create backup files during off-peak hours, and use the latest backup file or historical backup files to create a cache analysis task.

  • Why is the value of Memory Usage of Keys that is displayed in analysis results smaller than the value of Used Memory?

    Cache analysis only parses the amount of memory that is used by keys and their values after serialization in the involved Redis Database (RDB). This is only a part of the memory used by the instance. The memory used by the instance also includes the following parts:

    • The amount of memory that is used by byte alignment, structure variables, and structure pointers corresponding to keys and their values after a jemalloc process. For example, the size of byte alignment, structure variables, and structure pointers corresponding to 250 million keys and their values totals about 2 to 3 GB.

    • The amount of memory that is used by the client output buffer, query buffer, append-only file (AOF) rewrite buffer, and master-replica replication backlog of the 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.