gpt4 book ai didi

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

转载 作者:行者123 更新时间:2023-12-03 20:59:53 24 4
gpt4 key购买 nike

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

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com