redis stored Policy

1. Description of Requirement

  Phenomenon in Redis data are stored in memory. If the memory data has been added, it may cause memory is full, the memory overflow. Redis need to control the size of memory.

 

2.LRU algorithm

      Memory Management one kind of the page replacement algorithm, but not for the memory block (memory block) is called LRU, the operating system which data belongs based on LRU and move it out of memory to make room to load additional data.

 

3. Memory policy introduced

volatile - LRU data has been set in the timeout period, the least used data selected for deletion. 

AllKeys - LRU select all values, using an LRU algorithm to delete. 

volatile - Random data set timeout randomly deleted. 

AllKeys - random random removed so the key in. 

volatile - ttl in the data set timeout, the timeout flashback in accordance with the arrangement, deletion of expired data immediately. 

Noeviction (default policy) If you select this mode, do not delete data , directly to user error.

 

3.1 Memory policy modification

560 line

 

Guess you like

Origin www.cnblogs.com/gxlaqj/p/11588247.html