Redis do about the cache optimization

The company redis been used for cache buffer, if it do not optimize the default elimination mechanism, will appear after the memory usage reaches the upper limit in a variety of command error.
The official described as follows
noeviction: return errors when the memory limit was reached and the client is trying to execute commands that could result in more memory to be used (most write commands, but DEL and a few more exceptions).

Since a cache needs to be done to optimize
online modification
landed
## ***: 6379>
CONFIG the SAVE the SET "" turn off the local persistence
CONFIG SET maxmemory 10G using the maximum amount of memory (actual memory resources)
CONFIG maxmemory the SET-Policy "AllKeys-the LRU" elimination mechanism set up after the maximum memory

官方对淘汰机制的描述。
allkeys-lru: evict keys by trying to remove the less recently used (LRU) keys first, in order to make space for the new data added.

For additional optimization and elimination mechanism to select, please refer to the official
https://redis.io/topics/lru-cache

Guess you like

Origin blog.51cto.com/12102819/2416382