python - 如何在 Google 应用引擎上部署 Celery Worker

标签 python django google-app-engine rabbitmq celery

我有一个 Celery worker 需要部署到 Google 应用引擎,这可能吗?
我打算将一个应用程序用于我的主要 Django 应用程序,一个用于 Celery worker 的应用程序和一个 Rabbitmq 服务(它由 Google 云支持)

最佳答案

我建议使用 App Engine Task Queue 而不是使用 Celery 任务队列。

您可以使用 Push queues :

Push queues run tasks by delivering HTTP requests to App Engine worker services. They dispatch these requests at a reliable, steady rate and guarantee reliable task execution. Because you can control the rate at which tasks are sent from the queue, you can control the workers' scaling behavior and hence your costs.



Pull queues :

Pull queues do not dispatch tasks at all. They depend on other worker services to "lease" tasks from the queue on their own initiative. Pull queues give you more power and flexibility over when and where tasks are processed, but they also require you to do more process management. When a task is leased the leasing worker declares a deadline. By the time the deadline arrives the worker must either complete the task and delete it or the Task Queue service will allow another worker to lease it.

关于python - 如何在 Google 应用引擎上部署 Celery Worker,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/58875630/

相关文章:

python - 部分目录列表

python - 将列表拆分为范围为 n 的列表列表

python - 如何使用 python 和 Django 高效导出大型 Excel 文件

python - 如何创建多个对象以及提供了外键字段的外键?

python - 六:无法导入名称python_2_unicode_兼容

google-app-engine - 每个 App Engine 应用允许 3,000 个文件(而不是 1,000 个)是否正确?

google-app-engine - Google App Engine 错误 : (gcloud. app.deploy) INVALID_ARGUMENT:组合版本和服务(模块)名称太长

python - 如何在没有 $HOME/py36/bin/python 的情况下运行 Python 3.6

python - 在Python中反转字典不会产生结果

python - Google App Engine 还是 Django?