[Redis] out of memory strategies

A description

redis default is not set maxmemory field, maxmemory redis process for the maximum memory in bytes


Two, maxmemory-policy

When the time set maxmemory field, i.e., the memory size limits the process, then redis when the stored data is greater than the set value,

We need to think of ways to delete data redis in order to vacate space to save the new storage requirements


Third, the parameters

maxmeory-policy has the following six strategies:

1.volatile-lru: Set the key in the least recently used outdated collection

2.allkeys-lru: All set key the least recently used

3.volatile-random: the set key using a random set of expired

4.allkeys-random: the set of all use random key

5.volatile-ttl: expired in the collection, recently expiring key time

6.noevicition: no delete key, but the memory is full, immediate return to operational errors, and prompts oom


Published 140 original articles · won praise 28 · views 180 000 +

Guess you like

Origin blog.csdn.net/qq_16097611/article/details/80038622