How does Redis Streams handle using up all availab

2020-04-19 19:25发布

问题:

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



标签: redis