Redis Streams 如何处理用完所有可用内存? [英] How does Redis Streams handle using up all available memory?

查看:45
本文介绍了Redis Streams 如何处理用完所有可用内存?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当所有可用内存都用完时,Redis 将如何处理 XADD?是否会从流中删除最旧的项目并添加新项目?从添加时起,旧项目是否仍然存在于 AOF 文件中?它只会抛出错误而不添加新项目吗?我应该期待什么?

How will Redis handle an XADD when all available memory is used? Will the oldest item(s) be deleted from the stream and the new item added? Will the old item still exist in the AOF file from when it was added? Will it just throw an error and not add the new item? What should I expect?

推荐答案

Streams 和其他所有数据结构一样,因此 Redis 将尊重 maxmemorymaxmemory-policyRAM压力的情况.根据政策,新的写入请求将被拒绝,或者现有的密钥(流与否)将被驱逐.

Streams are data structures like all others, so Redis will respect the maxmemory and maxmemory-policy in case of RAM pressure. Depending on the policy, new write requests will be denied, or existing keys (streams or not) will be evicted.

https://redis.io/topics/lru-cache

这篇关于Redis Streams 如何处理用完所有可用内存?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆