nosql - Which maxmemory policies allow expiration in Redis? -


which maxmemory policies compatible redis expiration mechanisms?

is volatile-ttl? noeviction stop old records death?

see here redis.conf:

maxmemory policy: how redis select remove when maxmemory reached. can select among 5 behaviors:

volatile-lru -> remove key expire set using lru algorithm allkeys-lru -> remove key according lru algorithm volatile-random -> remove random key expire set allkeys-random -> remove random key, key volatile-ttl -> remove key nearest expire time (minor ttl) noeviction -> don't expire @ all, return error on write operations

note: of above policies, redis return error on write operations, when there no suitable keys eviction.

  @ date of writing these commands are: set setnx setex append   incr decr rpush lpush rpushx lpushx linsert lset rpoplpush sadd   sinter sinterstore sunion sunionstore sdiff sdiffstore zadd zincrby   zunionstore zinterstore hset hsetnx hmset hincrby incrby decrby   getset mset msetnx exec sort 

the default is:

maxmemory-policy noeviction

if keep policy @ default 'noeviction' or if choose of volatile-* ones without having expirable keys in database, data remain in redis indefinitely. remember, however, if not delete data redis , keep adding more, you'll run out of memory.


Comments

Popular posts from this blog

Email notification in google apps script -

c++ - Difference between pre and post decrement in recursive function argument -

javascript - IE11 incompatibility with jQuery's 'readonly'? -