fix: set Redis maxmemory eviction policy to allkeys-lru#8063
Merged
Conversation
Redis had no `maxmemory-policy` configured, so it defaulted to `noeviction` — on reaching `maxmemory` it would reject every write with `OOM command not allowed` instead of freeing space. Set `--maxmemory-policy allkeys-lru` so Redis evicts the least-recently- used keys to make room for new writes. Everything stored here is a cache / lock / rate-limit entry with a TTL, so dropping cold keys is safe. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Contributor
There was a problem hiding this comment.
Code Review
This pull request updates the Redis configuration to use the allkeys-lru eviction policy, ensuring that cold keys are removed when memory limits are reached instead of failing writes. Feedback was provided to split the command-line flag and its value into separate array entries within the container arguments to ensure they are correctly parsed as distinct arguments.
Contributor
Contributor
|
🐋 This PR was built and pushed to the following Docker images: Targets: Platforms: Image Tag: |
dotansimha
approved these changes
May 23, 2026
Member
|
We've tested this as a hotfix and it seems stable and improves perf and overall results. Thanks @saihaj |
This was referenced May 23, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Add
--maxmemory-policy allkeys-lruto the Redis runtime args indeployment/utils/redis.ts.Why
Redis had no
maxmemory-policyconfigured, so it defaulted tonoeviction. On reachingmaxmemory(already set to 90% of the container limit), Redis rejects every write withOOM command not allowedinstead of freeing space.With
allkeys-lru, Redis evicts the least-recently-used keys to make room for new writes. Everything stored in this Redis is a cache / lock / rate-limit entry with a TTL, so dropping cold keys is safe and LRU keeps hot keys resident.🤖 Generated with Claude Code