是否可以使用 celery 来执行同步任务?

发布于 2024-10-03 19:22:24 字数 236 浏览 0 评论 0原文

几乎同步也可以工作;基本上,我想将 Web 应用程序背后的数据访问和处理委托给大多数作业的任务队列。对于 celery 任务,我认为合理的最快延迟是多少?

更新(为了澄清)

我想为了清楚起见,我应该解释一下吞吐量——虽然很好——对我来说不是一个必要的问题;我暂时还不需要朝这个方向扩展。延迟是我目前评估的唯一标准。我很乐意使用 task.apply 如果这是唯一可行的方法,但我想把工作分担一下。

Nearly synchronous works, too; basically, I want to delegate the data access and processing behind a web app to a task queue for most jobs. What's the fastest latency that I can consider reasonable for celery tasks?

Update (for clarification)

I guess for clarity I should explain that throughput -- while nice -- is not a necessary issue for me; I won't be needing scaling in that direction for a while, yet. Latency is the only criterion that I'll be evaluating at the moment. I'm content to use task.apply if that's the only way it'll work, but I'd like to farm the work out a bit.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

另类 2024-10-10 19:22:24

当我说吞吐量时,我指的是从发送任务到执行任务的平均延迟。对于“往返”,我指的是发送任务、执行任务、发回结果和检索结果所需的平均时间。

正如我在评论中所说,我目前没有任何官方数据可以分享,但
与许多其他解决方案相比,正确的配置 Celery 延迟较低,但它仍然比本地执行函数带来更多的开销。这是设计任务粒度时需要考虑的事情[1]

我目前正在编写可能感兴趣的性能指南:
http://ask.github.com/celery/userguide/optimizing.html

欢迎提供反馈,并想了解您感兴趣的任何其他性能因素。

[1] http://celeryq.org/docs/userguide/tasks.html#capsularity

When I say throughput I mean the average latency from sending a task until it's been executed. With roundtrip I mean the average time it takes to send a task, executing it, sending the result back and retrieving the result.

As I said in the comments I currently don't have any official numbers to share, but with
the right configuration Celery is low latency compared to many other solutions, but still it does come with more overhead than executing a function locally. This is something to take into account when designing the granularity of a task[1]

I'm currently writing a performance guide that may be of interest:
http://ask.github.com/celery/userguide/optimizing.html

Feedback welcome, and would like to know about any other performance factors you are interested in.

[1] http://celeryq.org/docs/userguide/tasks.html#granularity

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文