[A]redis to implement the principle of caching---> Cache technology with key expiration time settings---> Because Redis has limited memory, you can set maxmemory parameters in the Redis configuration file. To limit the size of the maximum available memory for Redis. (in bytes), when this limit is exceeded, Redis can delete unwanted keys according to the policy specified by the Maxmemory-policy parameter until Redis consumes less memory than the specified memory--->LRU (least recently used) Least recently used---> The fact that Redis does not back down accurately deletes the longest unused key from the entire database. Instead, each time a random 3 keys are taken from the database and the longest unused key is removed from the 3 keys. Deleting the closest key to the expiration time is also the method. "3" This number can be set through the Redis profile maxmemory-samples parameter [two]redis the policy of the deprecated key supported
Rules |
Description |
Volatile-lru |
Remove a key using the LRU algorithm (only for keys that have an expiration time set) |
Allkeys-lru |
Remove a key using the LRU algorithm |
Volatile-random |
Randomly delete a key (only for keys that have an expiration time set) |
Allkeys-random |
Randomly delete a key |
Volatitle-ttl |
Delete the last key of the expiration time |
Noeviction |
Do not delete key only return error |
Redis (11) The ability of Redis to implement caching