Home > Database > Redis > body text

How to set the maximum memory occupied by redis

王林
Release: 2020-12-17 09:18:43
forward
2989 people have browsed it

How to set the maximum memory occupied by redis

Setting method:

(Learning video sharing: redis video tutorial)

Redis settings occupy a physical machine Maximum memory

#占用最大20G
maxmemory 20480mb
Copy after login

Redis setting memory cannot be loaded, limited deletion is about to expire.

When the currently used memory exceeds the maxmemory limit, the active cleanup policy is triggered

  • volatile-lru: Only perform LRU on keys with an expiration time set (default value)

  • allkeys-lru: Delete the lru algorithm's

  • keyvolatile-random: Random deletion is about to expire

  • keyallkeys-random: Randomly delete

  • ##volatile-ttl: Delete the soon-to-expire

  • noeviction: Never expire, return error when mem_used memory The setting of maxmemory has been exceeded. For all read and write requests

  • #超过后删除即将过期的
    maxmemory-policy  volatile-ttl
    Copy after login
    Related recommendations:

    redis database tutorial

    The above is the detailed content of How to set the maximum memory occupied by redis. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:csdn.net
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!