Skip to content

Conversation

kdambekalns
Copy link
Member

Over time, Redis's memory allocation can become fragmented, especially in environments with a large number and variety of write, delete, and update operations. Redis 4.0 and newer versions include an active memory defragmentation feature, which helps in reclaiming unused memory and reducing fragmentation.

Over time, Redis's memory allocation can become fragmented, especially in environments with a large number and variety of write, delete, and update operations. Redis 4.0 and newer versions include an active memory defragmentation feature, which helps in reclaiming unused memory and reducing fragmentation.
@kdambekalns kdambekalns self-assigned this Jun 11, 2025
@kdambekalns
Copy link
Member Author

kdambekalns commented Jun 11, 2025

But https://cloud.google.com/memorystore/docs/redis/memory-management-best-practices#manage_your_system_memory_usage_ratio says:

If the system memory usage ratio exceeds 80%, turn on activedefrag. Defragmentation can take hours to release fragmented memory. If write traffic is high, defragmentation alone may not be enough to stop your instance from running out of memory.

Maybe we should monitor "system memory usage ratio" first? Or do we follow the people at Redis Labs (https://serverfault.com/a/971879)?

Active defrag has a performance cost, sure, but it is almost always negligible. Although it is disabled by default in the OSS distro, we (Redis Labs) have been using in production for ages ;)

@kitsunet
Copy link
Member

kitsunet commented Jun 11, 2025

I think this is fine for our usage scenarios as we typical projects on beach do not use redis under high (computing) pressure.

@robertlemke
Copy link
Member

I also think we can just go for it, however if possible, I would like that we run a local test setup where we trigger Redis so that we can really observe the difference.

@kdambekalns
Copy link
Member Author

I'll do some tests using https://redis.io/docs/latest/operate/oss_and_stack/management/optimization/benchmarks/, might show something useful…

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants