Redis的KEYS操作是否会影响LRU驱逐策略?

huangapple go评论44阅读模式
英文:

Does redis KEYS operation affect LRU eviction policy

问题

I am wondering if using KEYS does affect the LRU eviction policy? Let's say I grab all the keys using KEYS command, does that count as all keys have been recently used thus resetting the LRU and in turn makes the eviction act almost randomly?

Read the documentation on redis, found no answers on it.

英文:

I am wondering if using KEYS does affect the LRU eviction policy? Let's say I grab all the keys using KEYS command, does that count as all keys have been recently used thus resetting the LRU and in turn makes the eviction act almost randomly?

Read the documentation on redis, found no answers on it.

答案1

得分: 1

不会更新 LRU 或 LFU 统计。

然而,在生产环境中,您绝不应该使用 KEYS 命令,因为它可能会导致 Redis 长时间阻塞。

英文:

NO, it does NOT update LRU or LFU stats.

However, you should never use KEYS command in production environment, since it might block Redis for a long time.

huangapple
  • 本文由 发表于 2023年3月9日 17:45:39
  • 转载请务必保留本文链接:https://go.coder-hub.com/75682829.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定