When maxmemory is reached and eviction is in progress, if a stream data type is selected, discard the oldest X messages instead of the entire stream.

Ideally there would also be a means to tune to eviction selection algorithm: some people may wish to select streams with more messages more frequently.

This would allow a redis database to be dedicated to streams, and would automatically cap total memory usage without requiring per stream tuning. It would effectively allow a best-effort approach to message queue length maximisation, while effectively guaranteeing recent messages were never purged in normal operation.

Comment From: itamarhaber

Hello @nicois

Thanks for proposing this feature. While thought-provoking, it appears that you're the sole person who's interested in this feature :) I assume that with proper provisioning (and monitoring) this can be managed so I'll be closing this issue now - do feel free to reopen or create a new issue if needed.