Is there a database based key eviction policy in redis when RAM is full
Asked Answered
D

1

7

I am using 5 databases in my redis server. I want to evict keys belonging to a particular DB using LRU mechanism. Is it possible ?

I read this: how-to-make-redis-choose-lru-eviction-policy-for-only-some-of-the-keys.

But all my databases are using time to live for their entries. So cant use volatile-lru policy.

I tried volatile-ttl policy but other databases are having less ttl for their keys. So they will get evicted which I dont want.

Decarburize answered 21/10, 2015 at 7:32 Comment(0)
N
6

That's one of the effects of using numbered/shared database - they all share the same configuration and resources. You should consider using separate Redis servers, one for each of your databases, to have better control over what gets evicted and when. Even more importantly, using dedicated instances allows you to better utilize the cores that you server has.

Necessitate answered 21/10, 2015 at 8:15 Comment(2)
I read about using different redis instances on the same server. We can easily do it by launching another daemon with a different port which reads its configuration from a different file. (Not default redis.config).This works fine in my dev. But I am using Amazon's AWS elasticache redis in production. Not sure if we can push a separate daemon in elasticache redis. Is it possible ?Decarburize
No, that isn't possible with elasticache as far I know. There is, however, one RaaS (Redis-as-a-Service) provider that supports this mode of operation (i.e. dedicated Redis instances) so if that's something you're interested in you should check out Redis Cloud.Necessitate

© 2022 - 2024 — McMap. All rights reserved.