개발

Redis cache eviction

빠빠담 2023. 6. 15. 02:18
반응형

 

https://redis.io/docs/reference/eviction/

Eviction policies

The exact behavior Redis follows when the maxmemory limit is reached is configured using the maxmemory-policy configuration directive.

The following policies are available:

Policy    
noeviction New values aren’t saved when memory limit is reached. When a database uses replication, this applies to the primary database 설전된 maxmemory 제한에 도달하면 새 값이 저장되지 않으며, 추가되는 command 실행 실패
allkeys-lru Keeps most recently used keys; removes least recently used (LRU) keys 가장 최근에 사용한 keys 유지 및 가장 최근에 사용되지 않은 keys를 삭제
allkeys-lfu Keeps frequently used keys; removes least frequently used (LFU) keys 자주 사용하는 keys를 보관 및 참조 횟수가 가장 적은 keys를 삭제
volatile-lru Removes least recently used keys with the expire field set to true. EXPIRE SET 내의 keys를 대상으로 LRU 알고리즘 적용하여 keys를 삭제
volatile-lfu Removes least frequently used keys with the expire field set to true. EXPIRE SET 내의 keys를 대상으로 LFU 알고리즘 적용하여 keys를 삭제
allkeys-random Randomly removes keys to make space for the new data added. 추가된 새로운 데이터를 위한 메모리 공간을 만들기 위해 무작위로 keys를 삭제
volatile-random Randomly removes keys with expire field set to true. EXPIRE SET 내의 keys를 대상으로 무작위로 keys를 삭제
volatile-ttl Removes keys with expire field set to true and the shortest remaining time-to-live (TTL) value. EXPIRE SET 내의 keys를 대상으로 TTL이 짧은 순서로 keys를 삭제

 

 

https://chagokx2.tistory.com/102

 

Redis 내부 동작 원리와 최적화 방안

https://s-core.co.kr/insight/view/redis-%EB%82%B4%EB%B6%80-%EB%8F%99%EC%9E%91-%EC%9B%90%EB%A6%AC%EC%99%80-%EC%B5%9C%EC%A0%81%ED%99%94-%EB%B0%A9%EC%95%88/

 

https://charsyam.wordpress.com/2022/01/28/%EC%9E%85-%EA%B0%9C%EB%B0%9C-redis-lruleast-recently-used-algorithm%EC%97%90-%EB%8C%80%ED%95%B4%EC%84%9C/

 

https://youtu.be/92NizoBL4uA

 

반응형

'개발' 카테고리의 다른 글

Redis Fragmentation  (0) 2023.06.18
캐싱 전략  (0) 2023.06.17
OS 메모리 관리  (0) 2023.06.15
Generics / Variance  (0) 2023.06.04
BASE Principle  (0) 2023.06.04