From 0b0d0c8e541f1f758213e092df72115866455648 Mon Sep 17 00:00:00 2001 From: Burak Yigit Kaya Date: Tue, 19 Nov 2024 16:34:41 +0000 Subject: [PATCH] fix(redis): Use a safer eviction rule (#3432) Follow up to https://github.com/getsentry/self-hosted/pull/3427#issuecomment-2485612688 --- redis.conf | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/redis.conf b/redis.conf index 25103a8811..090b148b15 100644 --- a/redis.conf +++ b/redis.conf @@ -14,13 +14,14 @@ maxmemory 0 -# maxmemory-policy allkeys-lru -# # This setting determines how Redis evicts keys when it reaches the memory limit. -# 'allkeys-lru' evicts the least recently used keys from all keys stored in Redis, +# `allkeys-lru` evicts the least recently used keys from all keys stored in Redis, # allowing frequently accessed data to remain in memory while older data is removed. -# -# Example: -# maxmemory-policy allkeys-lru # Use LRU eviction for all keys +# That said we use `volatile-lru` as Redis is used both as a cache and processing +# queue in self-hosted Sentry. +# > The volatile-lru and volatile-random policies are mainly useful when you want to +# > use a single Redis instance for both caching and for a set of persistent keys. +# > However, you should consider running two separate Redis instances in a case like +# > this, if possible. -maxmemory-policy allkeys-lru +maxmemory-policy volatile-lru