Redis Transport Based in Sorted Sets (BZMPOP) #2435
oliverhaas
started this conversation in
Ideas
Replies: 1 comment
-
|
Here is a newer version of the idea as an actual transport in a package https://pypi.org/project/celery-redis-plus/. Sorted sets with I will aim to submit this to Celery/Kombu somehow in the near future. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
I've been playing around with changing how queues work in the Redis transport.
The main idea of this discussion: use sorted sets instead of lists.
Branch to check it out: [EDIT: Outdated] https://github.com/celery/kombu/tree/redis-transport-rework. The implementation is not yet cleaned up and could probably use a few pipelines or even lua scripts to make the whole thing more efficient.
Main points
BZMPOPinstead of lists withBRPOP. This introduces the main downside: Requires Redis 7.0+ for BZMPOP, which I personally think is fine, but would mean that the old redis transport has to probably be supported for quite a while.visibility_timeoutcan now be MUCH smaller without any downside, since we're keeping track of the messages in another sorted set. Meaning even a visibility_timeout of like 3 minutes is feasible, and would mean a "stuck" message is directly detected much quicker and directly restored.I might already start using this in production within the next month, but I would appreciate feedback here, especially if I'm missing something obvious.
Beta Was this translation helpful? Give feedback.
All reactions