Skip to content

fix: set Redis maxmemory eviction policy to allkeys-lru#8063

Merged
dotansimha merged 2 commits into
mainfrom
redis-eviction-policy
May 23, 2026
Merged

fix: set Redis maxmemory eviction policy to allkeys-lru#8063
dotansimha merged 2 commits into
mainfrom
redis-eviction-policy

Conversation

@saihaj

@saihaj saihaj commented May 22, 2026

Copy link
Copy Markdown
Member

What

Add --maxmemory-policy allkeys-lru to the Redis runtime args in deployment/utils/redis.ts.

Why

Redis had no maxmemory-policy configured, so it defaulted to noeviction. On reaching maxmemory (already set to 90% of the container limit), Redis rejects every write with OOM command not allowed instead 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

saihaj and others added 2 commits May 22, 2026 16:50
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>

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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.

Comment thread deployment/utils/redis.ts
@github-actions

Copy link
Copy Markdown
Contributor

🚀 Snapshot Release (alpha)

The latest changes of this PR are available as alpha on npm (based on the declared changesets):

Package Version Info
hive 11.1.2-alpha-20260522205754-37a023ff4e4cc583f1b9a690c3e937ff4b759ca9 npm ↗︎ unpkg ↗︎

@github-actions

github-actions Bot commented May 22, 2026

Copy link
Copy Markdown
Contributor

🐋 This PR was built and pushed to the following Docker images:

Targets: build

Platforms: linux/amd64

Image Tag: 37a023ff4e4cc583f1b9a690c3e937ff4b759ca9

@dotansimha

Copy link
Copy Markdown
Member

We've tested this as a hotfix and it seems stable and improves perf and overall results. Thanks @saihaj

@dotansimha dotansimha requested a review from n1ru4l May 23, 2026 05:04
@dotansimha dotansimha merged commit 19d3822 into main May 23, 2026
22 of 23 checks passed
@dotansimha dotansimha deleted the redis-eviction-policy branch May 23, 2026 08:05
This was referenced May 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants