为什么要使用Rabbitmq

It all depends on what you want to use it for.

RabbitMQ is the recommended solution, it is widely deployed, tested and supports all features. With optimized configuration you can process up to 15000 persistent tasks/s with a single process. RabbitMQ also comes with management and monitoring solutions (full disclosure: I work with the RabbitMQ team at VMware, and I'm the Celery project lead).

Redis is also a popular option, it supports almost all features, but it is not very durable in its default configuration, if the Redis server is abruptly terminated you may at worst lose minutes of data (http://redis.io/topics/persistence). Even with append-only mode there is a chance of data loss if the celeryd instance is abruptly killed: this is because Redis does not support message acknowledgements. We are working on a patch to emulate this, but that will impact performance quite a lot (in the mean-time you should set CELERYD_PREFETCH_MULTIPLIER=1 to minimize the impact of such a data loss scenario).

The database backends were originally made for testing purposes only, but they are used in production nonetheless. The database backends also does not support events and broadcast, so the Celery monitor and remote control commands (celeryctl) will not work. It may work well enough for small deployments, but if you ever have the need to add more celeryd instances you should pick another option. Sadly, databases are not usually suited for this kind of work (though postgres 9 comes with new features that makes it "more suitable", that we may eventually support).

MongoDB I have not had much experience with myself, but I know the Celery backend is being used and is actively maintained (it just recently gained support for monitoring and remote control support). I imagine, though, that it has the same durability problems as mention above with Redis.

In addition there is support for using Amazon SQS, Beanstalk, CouchDB. These backends do not support monitoring and remote control commands.

In short; If not losing tasks is crucial, you should be using RabbitMQ. The database backend is OK with low task volumes and one or maybe two celeryd instances.

转载于:https://www.cnblogs.com/skyendless/archive/2012/03/06/2381851.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值