Skip to content
Open
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion redis.conf
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
# maxmemory 0 # Unlimited memory usage
# maxmemory 15gb # Limit memory usage to 15 GB

maxmemory 0
maxmemory 2gb
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is absolutely crucial for maxmemory-policy to kick in.

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

Use the maxmemory-policy configuration directive to select the eviction policy you want to use when the limit set by maxmemory is reached.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would argue that 2gb is not enough. I would prefer 8gb of 12gb.

Copy link
Author

@kixorz kixorz Oct 9, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

8 or 12g requires a large and more expensive instance.

We have a relatively busy instance and 2g works fine for us.

Copy link
Collaborator

@aldy505 aldy505 Oct 9, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Redis is just a cache, the system may only be slightly slower in certain situations.

Surprisingly that's not how Sentry uses Redis.

Memcached is being used just for caching. But Redis, it's being used as (1) lock contention store, (2) storing uptime monitor configuration, (3) storing project configs that is used for validating incoming SDK envelopes, and much more that I can't remember. These are not really "caches" for me though.

Although, I understand that this shouldn't how you use Redis, but it's a live software anyway, we can only work around it.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are those use cases subject to cache eviction?


# 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,
Expand Down
Loading