[英]Celery: When should you choose Redis as a message broker over RabbitMQ?
My rough understanding is that Redis is better if you need the in-memory key-value store feature, however I am not sure how that has anything to do with distributing tasks?我的粗略理解是,如果您需要内存中的键值存储功能,那么 Redis 会更好,但是我不确定这与分发任务有什么关系?
Does that mean we should use Redis as a message broker IF we are already using it for something else?这是否意味着我们应该使用 Redis 作为消息代理,如果我们已经将它用于其他用途?
I've used both recently (2017-2018), and they are both super stable with Celery 4. So your choice can be based on the details of your hosting setup. 我最近使用过(2017-2018),它们与Celery 4都非常稳定。所以你的选择可以基于你的主机设置的细节。
In the past, I would have recommended RabbitMQ because it was more stable and easier to setup with Celery than Redis, but I don't believe that's true any more. 在过去,我会推荐RabbitMQ,因为它比使用Redis更安静,更容易设置Celery,但我不相信这是真的。
AWS now has a managed service that is equivalent to RabbitMQ called Amazon MQ, which could reduce the headache of running this as a service in production. AWS现在有一个托管服务,相当于名为Amazon MQ的RabbitMQ,这可以减少将其作为生产服务运行的麻烦。 Please comment below if you have any experience with this and celery.
如果您对此和芹菜有任何经验,请在下面评论。
The Redis broker gives tasks to workers in a fair round robin between different queues. Redis 代理在不同队列之间以公平的循环方式将任务分配给工作人员。 Rabbit is FIFO always.
兔子总是先进先出。 For me, a fair round robin was preferable and I tried both.
对我来说,公平的循环赛更可取,我都试过了。 Rabbit seems a tad more stable though.
兔子似乎更稳定一点。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.