ApsaraDB for Redis provides an efficient database service. Insufficient memory may cause issues such as frequently evicted keys, increased response time, and an unstable number of queries per second (QPS). These issues may interrupt your workloads. If the memory usage exceeds 95%, you must respond in a timely manner.
Memory usage of ApsaraDB for Redis
The memory usage of ApsaraDB for Redis is divided into the following three parts:
Memory usage | Description |
---|---|
Memory consumed by link-related operations | Includes the memory consumed by the input buffer, the memory consumed by the output
buffer, the memory consumed by the JIT overhead, the memory consumed by the Fake Lua
Link, and the memory consumed to cache the executed Lua scripts. The memory consumption
dynamically changes. You can run the INFO command and obtain the client cache information from the Clients column in the return result.
Note The memory consumed by the input buffer and output buffer is small and varies based
on the number of connections from each client. When a client initiates range-based
operations or when a client sends and receives big keys at low speeds, the memory
consumed by the input buffer and output buffer increases. As a result, the memory
that can be used to store data decrease, and out of memory (OOM) issues may occur.
|
Memory consumed by data | Includes the memory consumed to store field values. This part of memory consumption is a crucial object that needs to be analyzed. |
Memory consumed by management operations | Includes the memory consumed by hash sets, the memory consumed by the replication
buffer, and the memory consumed by the append-only file (AOF) buffer. The memory consumption
remains stable within the range of 32 MB to 64 MB, which is small.
Note If the number of keys is large, such as hundreds of millions, this part of memory
consumption increases.
|
Note Most OOM issues occur due to inefficient management of dynamically acquired and freed
memory. For example, if a large number of requests are piled up due to throttling,
the amount of dynamically acquired memory rapidly increases. OOM issues may also occur
due to complex or inappropriate Lua scripts. The management of dynamically acquired
and freed memory is enhanced in ApsaraDB for Redis Enterprise Edition (Tair). We recommend
that you use ApsaraDB for Redis Enterprise Edition (Tair). For more information, see
Overview of ApsaraDB for Redis Enhanced Edition (Tair).