PoC: Redis Streams for immediate task delivery #492
+571
−100
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This pull request introduces a proof of concept for using Redis Streams to improve immediate task delivery in ARQ. The current ARQ implementation faces significant scaling challenges, especially in high-load, distributed environments.
Current Problem:
When handling large volumes of small, quick tasks (e.g., 300 tasks/sec) across multiple workers (10-30+), ARQ’s task distribution model struggles with:
Proposed Solution:
This pull request explores how Redis Streams can be used for immediate task delivery to address these inefficiencies:
Backwards Compatibility (almost):
Key Benefits:
This PoC PR that demonstrates that this approach indeed possible and works. After sync with maintainers, this PR can be finished.
Benchmark results
They are not quite reliable as it was tested on a laptop with Redis in a Docker container. But here are some numbers:
Tasks with no delay
Current implementation
Redis streams implementation
Tasks with 1 second delay
Current implementation
Redis streams implementation