Using Resque with redis I've been getting redis's OOM command not allowed when used memory > 'maxmemory'
error. Now clearly it seems i should increase the memory redis has from the current 500MB, yet I want to make sure i have the correct max-memory / data-eviction policy set for using redis with resque as well. currently it is on volatile-lru. (Ive look for docs on this but cant find anything.)
this stackoverflow answer along with the following data from redis..
keys=81824,expires=0,avg_ttl=0
evicted_keys 0
expired_keys 0
...leads me to believe that I have something misconfigured and that adding more memory will just put off the problem.
if it matters Replication and Data persistance are currently both off.
When using Resque, you do not want any of Resque's keys to be evicted by Redis. Resque itself will delete keys that are no longer needed. As such, you should use either noeviction
or volatile-lru
as the maxmemory-policy
; neither will evict keys that do not have an expire time set.
If Redis runs out of memory with these policies, that means your Resque queues are getting too long and you need to either increase maxmemory
(and possibly provide more RAM) or reduce the number of Resque jobs (using data batching techniques, etc.).