memory - Redis 中 maxmemory_policy 的可能值是多少?

标签 memory redis

在Redis的例子中INFO页面,有一个 maxmemory_policy 设置:

maxmemory_policy:noeviction

似乎没有关于此的任何文档。可能的值是什么,默认值是什么?

最佳答案

redis.conf 中详细介绍了不同的驱逐政策文件:

# MAXMEMORY POLICY: how Redis will select what to remove when maxmemory
# is reached. You can select among five behaviors:
#
# 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
#
# Note: with any of the above policies, Redis will return an error on write
#       operations, when there are no suitable keys for eviction.
#
#       At the date of writing these commands are: set setnx setex append
#       incr decr rpush lpush rpushx lpushx linsert lset rpoplpush sadd
#       sinter sinterstore sunion sunionstore sdiff sdiffstore zadd zincrby
#       zunionstore zinterstore hset hsetnx hmset hincrby incrby decrby
#       getset mset msetnx exec sort
#
# The default is:
#
# maxmemory-policy noeviction

关于memory - Redis 中 maxmemory_policy 的可能值是多少?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/29790518/

相关文章:

c# - C# 中的实例大小

ipad - 继续使用后,iPad的运行速度变慢并卡住在独立模式下

python 内存问题

websocket - Rails 5 actioncable 未定义方法 `fetch' 为 nil :NilClass

java - 添加数组作为 Kubernetes 环境变量

c - 字符串文字 : Where do they go?

c - 从内核分配用户空间内存

redis - The previous queued operation has not been committed 错误在 ServiceStack Redis 客户端

ruby-on-rails - 使用 Sidekiq 的 Redis 连接池实现 Multi-Tenancy (命名空间)设置

redis - 无法连接到 Redis;嵌套异常是 io.lettuce.core.RedisConnectionException 使用 ReactiveRedisTemplate