Skip to content

Commit 0b0d0c8

Browse files
authored
fix(redis): Use a safer eviction rule (#3432)
Follow up to #3427 (comment)
1 parent c3814f0 commit 0b0d0c8

File tree

1 file changed

+8
-7
lines changed

1 file changed

+8
-7
lines changed

redis.conf

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,14 @@
1414

1515
maxmemory 0
1616

17-
# maxmemory-policy allkeys-lru
18-
#
1917
# This setting determines how Redis evicts keys when it reaches the memory limit.
20-
# 'allkeys-lru' evicts the least recently used keys from all keys stored in Redis,
18+
# `allkeys-lru` evicts the least recently used keys from all keys stored in Redis,
2119
# allowing frequently accessed data to remain in memory while older data is removed.
22-
#
23-
# Example:
24-
# maxmemory-policy allkeys-lru # Use LRU eviction for all keys
20+
# That said we use `volatile-lru` as Redis is used both as a cache and processing
21+
# queue in self-hosted Sentry.
22+
# > The volatile-lru and volatile-random policies are mainly useful when you want to
23+
# > use a single Redis instance for both caching and for a set of persistent keys.
24+
# > However, you should consider running two separate Redis instances in a case like
25+
# > this, if possible.
2526

26-
maxmemory-policy allkeys-lru
27+
maxmemory-policy volatile-lru

0 commit comments

Comments
 (0)