Ayush Lodha
Ayush Lodha

Reputation: 181

how to change maxmemory-policy of redis amazon elasticache in rails?

I am using redis-store gem to configure rails cache_store to use amazon elasticache redis. I want to set the eviction policy to allkeys-lru. However I am not able to find a way to do that from within rails.

Upvotes: 6

Views: 8383

Answers (1)

Liviu Costea
Liviu Costea

Reputation: 3784

In AWS Elasticache you need to create a new Cache Parameter Group for Redis and you can then edit such parameters. The default for maxmemory-policy is volatile-lru so you need to change that to allkeys-lru http://docs.aws.amazon.com/AmazonElastiCache/latest/UserGuide/CacheParameterGroups.Redis.html
Then when you create your cache service you need to specify this new parameter group that you created.
There is also the possibility to make all this automatically using the AWS Ruby SDK http://aws.amazon.com/sdk-for-ruby/
Here is the API description of the Elasticache client - with which you can create and edit parameter groups, handle the security groups, create new cache clusters etc. http://docs.aws.amazon.com/sdkforruby/api/Aws/ElastiCache/Client.html

Upvotes: 7

Related Questions