tencent cloud

Feedback

High Memory Utilization

Last updated: 2023-05-23 10:49:31

Symptom

Symptom 1: You received an alarm about too high memory utilization.
Symptom 2: On the System Monitoring page in the TencentDB for Redis console, you can view that there are sudden rises in Memory Utilization, Key Evictions, and P99 Response Latency.
Symptom 3: The error message command not allowed when used memory > 'maxmemory' was prompted when the program writes data.

Redis Memory Usage

The data that usually occupies memory in TencentDB for Redis includes the following:
Object memory: User data area, that is, the actual stored value information.
Buffer memory: Including client input and output buffers, and master-replica sync replication buffers.
Note
When performing Range operations or big keys on the client side, the memory occupied by input buff and output buff will increase, affecting the buffer and even causing OOM.
Memory fragmentation: A large number of update operations, such as append and setrange; a large number of expired keys are deleted, and the released space cannot be effectively used.
Link memory: The memory consumed for creating subprocesses, which is generally relatively small.

Troubleshooting the Issue

No.
Possible Cause
Troubleshooting Method
Solution
1
The increase in the volume of written data leads to an increase in memory usage.
The key is not set in the TTL policy.

1. Log in to the TencentDB for Redis console, click an instance ID, and enter the instance details page.
2. Select the System Monitoring tab to view the corresponding monitoring metrics of the TencentDB for Redis instance, including Memory Utilization, Total Keys, Expired Keys, and Evicted Keys. Then, you can analyze whether the memory utilization is consistent with the fluctuation trend of the number of keys.
If the memory usage is proportional to the total number of keys, the possible causes are as follows.
The memory may be increased due to the normal data written by the business. Evaluate your business needs and expand the Redis instance in time. For directions, see Changing Instance Specification.
The memory may increase due to the accumulation of keys due to the failure to set a reasonable eviction policy and deletion frequency for expired keys.
The eviction policy setting is unreasonable, which may easily cause invalid keys to occupy too much space. To modify the parameters related to key expiration time, eviction policy, and deletion frequency, reconfigure the maxmemory-policy and hz parameters on the Parameter Settings page in the console. For directions, see Setting Instance Parameters.
If the deletion frequency for expired keys is set too high, that is, if the value of hz increases, more CPU resources will be occupied. The hz value should not be too large. You can adjust it as needed.
2
Input buffer overflow is caused by writing a big key caused the .
Input buffer overflow is caused by reading a big key, requesting a large number of commands to return results, or executing a monitor command.
Analyze memory skew issues with the Performance Optimization feature of DBbrain. For more information, see Memory Analysis.
Perform value splitting and optimization for abnormally large keys. For more information, see Hot Key and Big Key.。

Contact Us

Contact our sales team or business advisors to help your business.

Technical Support

Open a ticket if you're looking for further assistance. Our Ticket is 7x24 avaliable.

7x24 Phone Support