6

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.

Community
  • 1
  • 1
revs
  • 63
  • 7

1 Answers1

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.

Itamar Haber
  • 47,336
  • 7
  • 91
  • 117
  • 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 ? – revs Oct 21 '15 at 13:37
  • 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. – Itamar Haber Oct 21 '15 at 14:10