zoukankan      html  css  js  c++  java
  • redis 数据淘汰策略与配置

    redis 数据淘汰策略

    volatile-lru:从已设置过期的数据集中挑选最近最少使用的淘汰
    volatile-ttr:从已设置过期的数据集中挑选将要过期的数据淘汰
    volatile-random:从已设置过期的数据集中任意挑选数据淘汰
    allkeys-lru:从数据集中挑选最近最少使用的数据淘汰
    allkeys-random:从数据集中任意挑选数据淘汰
    noenviction:禁止淘汰数据
    redis淘汰数据时还会同步到aof中、从机


    配置文件 

    # maxmemory <bytes>
    # volatile-lru -> remove the key with an expire set using an LRU algorithm
    # allkeys-lru -> remove any key according to the LRU algorithm
    # volatile-random -> remove a random key with an expire set
    # allkeys-random -> remove a random key, any key
    # volatile-ttl -> remove the key with the nearest expire time (minor TTL)
    # noeviction -> don't expire at all, just return an error on write operations
    # The default is:
    # maxmemory-policy noeviction
    我们可以设置maxmemory <bytes>,当数据达到限定大小后,会选择配置的策略淘汰数据

  • 相关阅读:
    Live2D 看板娘
    Live2D 看板娘
    Live2D 看板娘
    Live2D 看板娘
    Live2D 看板娘
    Live2D 看板娘
    Live2D 看板娘
    Live2D 看板娘
    Live2D 看板娘
    [转载]MySQL5.5 配置文件 my.ini 1067错误
  • 原文地址:https://www.cnblogs.com/Mike_Chang/p/9560509.html
Copyright © 2011-2022 走看看