How to get Redis to choose an LRU eviction policy for only some keys?

Is there a way to get Redis to choose the LRU eviction policy (least used) for only certain keys? I want the key set to be constant and never go out of memory. On the other hand, I want another set of keys to be freely evicted if there is little memory.

+3
source share
1 answer

Redis has an eviction policy that may be good for your case. You can set maxmemory-policy to volatile-lru, which calls Redis:

expire key using LRU algorithm

, , TTL, , , TTL .

, volatile-lru , , , , TTL , , .

+5

Source: https://habr.com/ru/post/1612543/


All Articles