Tair provides a highly 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 business. If the memory usage exceeds 95%, you must respond in a timely manner.
Memory usage of Tair
The memory usage of Tair 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 output.
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 large 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 decreases, 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 A large number of keys, such as hundreds of millions, consume large amounts of memory.
|
Note Most OOM issues occur due to inefficient management of dynamically acquired and released
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.