Redis (11) The ability of Redis to implement caching

Source: Internet
Author: User
Tags allkeys

[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

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.