3

According to the Celery docs, the SQLAlchemy broker has problems with "more than a few" workers and may execute tasks multiple times. I haven't been able to find more precise information on this. Does the choice of database matter? Given that the database is PostgreSQL 9.1, does someone have experience with how many "more than a few" are, and how common an occurrence this is? Does it happen all the time or only under extreme corner cases?

4

1 回答 1

1

不建议使用数据库作为任务代理,因为与 rabbitmq 或 redis 等其他代理(第一个是 celery 的最佳选择)相比,它的性能不佳。

这是因为工作人员将使用资源来轮询数据库以获取新任务并发布状态和结果。

Sqlalchemy 不应用作代理,除非您的任务数量非常有限且只有 1 个工作人员(又名开发/登台机器)

Rabbitmq 是推荐用于生产环境的代理,您应该使用它 :)

于 2013-04-15T15:30:36.077 回答