David
David

Reputation: 85

How does Redis Streams handle using up all available memory?

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?

Upvotes: 6

Views: 1520

Answers (1)

Itamar Haber
Itamar Haber

Reputation: 49942

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

Upvotes: 4

Related Questions