禁用 celery 工人的八卦,混合和心跳有什么后果? [英] What are the consequences of disabling gossip, mingle and heartbeat for celery workers?

查看:24
本文介绍了禁用 celery 工人的八卦,混合和心跳有什么后果?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

禁用八卦、交流和心跳对我的 celery 工人有什么影响?

What are the implications of disabling gossip, mingle, and heartbeat on my celery workers?

为了减少发送到 CloudAMQP 的消息数量以保持在免费计划内,我决定关注 这些建议.因此,我使用了选项 --without-gossip --without-mingle --without-heartbeat.从那时起,我的所有 celery 项目都默认使用这些选项,但我不确定是否有任何我不知道的副作用.

In order to reduce the number of messages sent to CloudAMQP to stay within the free plan, I decided to follow these recommendations. I therefore used the options --without-gossip --without-mingle --without-heartbeat. Since then, I have been using these options by default for all my celery projects but I am not sure if there are any side-effects I am not aware of.

请注意:

  • 我们现在转移到 Redis 代理,并且对发送到代理的消息数量没有太多限制
  • 我们有多个实例运行多个具有多个队列的 celery 工作器

推荐答案

这是基础 文档 没有给我们太多信息

This is the base documentation which doesn't give us much info

心跳

与工作人员和代理之间的通信有关(在您的情况下,代理是 CloudAMQP).见说明

Is related to communication between the worker and the broker (in your case the broker is CloudAMQP). See explanation

使用--without-heartbeat,worker 不会发送心跳事件

With the --without-heartbeat the worker won't send heartbeat events

混合

它只要求逻辑时钟";和撤销的任务"来自其他工作人员的启动.

It only asks for "logical clocks" and "revoked tasks" from other workers on startup.

取自 whatsnew-3.1

工作人员现在将尝试与同一集群中的其他工作人员同步.

The worker will now attempt to synchronize with other workers in the same cluster.

同步数据目前包括撤销的任务和逻辑时钟.

Synchronized data currently includes revoked tasks and logical clock.

这只会在启动时发生,并且会导致启动延迟一秒以收集来自其他工作线程的广播响应.

This only happens at startup and causes a one second startup delay to collect broadcast responses from other workers.

您可以使用 --without-mingle 参数禁用此引导步骤.

You can disable this bootstep using the --without-mingle argument.

另见文档

八卦

worker 将事件发送给所有其他 worker,这目前用于时钟同步",但也可以编写自己的事件处理程序,例如 on_node_join,参见 文档

Workers send events to all other workers and this is currently used for "clock synchronization", but it's also possible to write your own handlers on events, such as on_node_join, See docs

取自 whatsnew-3.1

工作人员现在被动订阅与工作人员相关的事件,例如心跳.

Workers are now passively subscribing to worker related events like heartbeats.

这意味着工作人员知道其他工作人员在做什么,并且可以检测他们是否离线.目前这仅用于时钟同步,但未来添加的可能性有很多,您可以编写利用此功能的扩展.

This means that a worker knows what other workers are doing and can detect if they go offline. Currently this is only used for clock synchronization, but there are many possibilities for future additions and you can write extensions that take advantage of this already.

一些想法包括共识协议、将任务重新路由到最佳工作人员(根据资源使用情况或数据位置)或在工作人员崩溃时重新启动.

Some ideas include consensus protocols, reroute task to best worker (based on resource usage or data locality) or restarting workers when they crash.

我们相信,虽然这是一个小小的补充,但它带来了惊人的可能性.

We believe that although this is a small addition, it opens amazing possibilities.

您可以使用 --without-gossip 参数禁用此引导步骤.

You can disable this bootstep using the --without-gossip argument.

这篇关于禁用 celery 工人的八卦,混合和心跳有什么后果?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆