Database Autonomy Service (DAS) provides the cache analysis feature that helps you analyze backup files of ApsaraDB for Redis instances to provide information about the total memory usage and the memory used by each large key. This feature helps you reduce issues such as insufficient memory and performance degradation that are caused by skewed keys. For a master-replica cluster instance of ApsaraDB for Redis Community Edition, the cache analysis feature can provide statistics about the memory usage on each node.
Limits
- The ApsaraDB for Redis instance for which you want to use the cache analysis feature must be connected to DAS and in the Accessed state.
- The cache analysis feature is available only for ApsaraDB for Redis Community Edition instances that run Redis 2.8 or later.
- ApsaraDB for Redis instances that are deployed in the China (Chengdu), UK (London), Germany (Frankfurt), and India (Mumbai) regions do not support the cache analysis feature.
Procedure
FAQ
- Why is the memory usage of keys that are displayed on the Details page less 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 different types of 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 an ApsaraDB for Redis instance?
In cache analysis for an ApsaraDB for Redis instance, the number of elements represents the length of elements for keys of the String type.
- What do I do if the following error occurs?
decode rdbfile error: rdb: unknown object type 116 for key XX
This error indicates that the ApsaraDB for Redis instance has Bloom keys. You can delete these keys from the instance, or upgrade the instance to Enhanced Edition (Tair) and change the Bloom structure to the TairBloom structure.
- 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.