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?
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试):
问题:
回答1:
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.
Read more about this at https://redis.io/topics/lru-cache