The cache analytics feature can analyze backup files of ApsaraDB for Redis and find big keys in your instances. This feature allows you to view the information about an instance, such as the memory usage, distribution, and expiration time of keys. You can optimize your instances based on the analytic results. This feature helps you resolve issues such as insufficient memory and performance degradation that are caused by the skewed distribution of keys.

Prerequisites

The instance is an instance of ApsaraDB for Redis Community Edition or a performance-enhanced, persistent memory-optimized, or storage-optimized instance of ApsaraDB for Redis Enhanced Edition (Tair). For more information about instances of ApsaraDB for Redis Enhanced Edition (Tair), see Performance-enhanced instances, Persistent memory-optimized instances, and Storage-optimized instances

Procedure

  1. Log on to the ApsaraDB for Redis console.
  2. In the top navigation bar of the page, select the region where the instance is deployed.
  3. On the Instances page, click the ID of the instance.
  4. In the left-side navigation pane, choose CloudDBA > Cache analysis.
    By default, the analytic results of the last day are displayed on the Cache analysis tab. You can specify another time range based on your requirements.
  5. On the Cache analysis tab, click Analyze.
    Cache analytics
  6. In the dialog box that appears, specify the node and analysis method.
    Specify the node and analysis method
    Parameter Description
    Select a node for analysis Select the ID of the node on which you want to perform cache analytics.
    Note You can select an instance or a node. If you select an instance that contains more than eight nodes, the system analyzes only the top eight nodes with the highest memory usage.
    Analysis Method The method that you use to analyze the cache. Valid values: Use Previous Backup File and Create a new backup and use the latest backup for analysis.
  7. Click OK.
    The system performs cache analytics and displays the analysis status. You can click Refresh to update the analysis status.
  8. Find the analysis task that is complete and click Details in the Actions column to view the details about the analytic results.
    Note If you select a cluster instance or a read/write splitting instance from the Select a node for analysis drop-down list, you can view the information about Relevant Nodes and select a node in the Details section of the Details page.
    • Basic Information: displays basic information about an instance such as the basic attributes and cache analytics method. Basic Information
    • Relevant Nodes: displays the memory usage and statistics about keys on each node of the instance. Result 1
    • Details: displays the details about an instance or a node, such as the memory usage, distribution of keys, memory usage and distribution of elements in keys, distribution of key expiration time, and ranking of big keys. Cache analytics details

FAQ

Why do I fail to perform cache analytics?
Figure 1. Cache analytics failure
Cache analytics failure

Bloom filter-related API operations, such as BF.ADD, on existing instances of ApsaraDB for Redis 4.0 are only for internal use. In addition, newly purchased instances of ApsaraDB for Redis 4.0 and major versions later than 4.0 no longer support Bloom filter-related API operations. Therefore, if you call Bloom filter-related API operations, you fail to perform cache analytics and unknown errors may occur. We recommend that you change the instance to a performance-enhanced instance of ApsaraDB for Redis Enhanced Edition (Tair) that supports the optimized Bloom filter.