Dear developer, hello. I am a beginner who is just starting to use Redis. I would like to inquire about the memory elimination strategy of Redis. My understanding is that when the memory is full, the set memory elimination strategy will be triggered, and the data written during this period will temporarily be stored in the buffer. My question is, how many keys will be deleted during the memory elimination process? Will the write operation be executed after the buffer data size is the same? I hope you can answer this? thank.

Comment From: sundb

My understanding is that when the memory is full, the set memory elimination strategy will be triggered,

yes, it does not mean exceeding physical memory, but config maxmemory. but you should enable config maxmemory-policy first.

and the data written during this period will temporarily be stored in the buffer.

no, there is no buffer, in this period you can't write any data into Redis.

My question is, how many keys will be deleted during the memory elimination process?

the eviction will stop till the used memory reduce to maxmemory.

Comment From: Sakura0001

我的理解是当内存充足之后就会触发设置的内存淘汰策略,

是的,超出了内存容量,但是是配置maxmemory。 但maxmemory-policy首先要启用配置。

在此期间写入的数据暂时保存在缓冲区中。

不,没有缓冲区,在此期间您无法将任何数据写入 Redis。

我的问题是,在内存中完成的过程中会删除多少个键?

直到使用内存减少到时,驱逐才会停止maxmemory

Thank you for your answer. Wishing you all the best