I'm trying to set maxmemory
and maxmemory-policy
in my cache_store configuration of my Rails app.
I did the following in my production.rb file:
redis_url = "redis://localhost:6379/0"
config.cache_store = :redis_store, redis_url, { :expires_in => 4.weeks ,
:namespace => 'rails-cache',
:maxmemory => '25gb',
'maxmemory-policy' => 'volatile-ttl'}
But the maxmemory doesn't seam to be working. When I do Rails.cache.methods
I don't get any methods about memory
or max
.
I dont' see any examples on the web for Rails, the closest thing was handling redis maxmemory situations with rails when using rails caching but it doesn't give any examples.
I also cloned and grepped for maxmemory
in the the redis-rb
gem (https://github.com/redis/redis-rb), but nothing comes up. So it seem like it has not been implemented.