如何在 Google 应用引擎上部署 Celery worker

How to deploy a Celery worker on Google app engine

我有一个 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.