监控间隔如何影响 ZeroMQ 中的网络流量 ~.1 [GB/s]?

How may the Monitor Interval effect the Network Traffic ~.1 [GB/s] in ZeroMQ?

所以,我有一个管理一堆使用 REQ/REPPUB/SUB[=35 的工作人员的流程=] 每个工蜂的模式。我将监视间隔设置为 250 [ms] 并且一切正常。

当我部署到 Windows 服务器上并启动资源监视器时,此节点进程的网络流量(写入的字节数)超过 64-100 [MB/s] 并且还不包括任何实际的应用程序事务,因为无论我是否启动 children ,流量都在那里,并且当 children 上线时它不会减弱。

怀疑我玩过增加值的间隔设置,请注意较高的间隔值(较少)确实会导致流量减少,但这样做的代价是需要很长时间才能检测到connect/disconnect 事件。

现在我还没有尝试缩小它到底是 REQ/REP 模式还是 PUB/SUB 模式 模式是问题所在,但我很好奇我忽略的文档的哪一部分可以解释这种行为。

我们可能会在下一个版本中换掉 ZeroMQ 或 GRPC,但我现在有问题要回答。

我相信我已经标记了与操作环境相关的所有内容。

When I deploy onto a Windows server, and startup the resource monitor, the amount of network traffic (bytes written) by this node process is upwards of 64-100 [MB/s]

我想您已经很清楚低级 ZeroMQ 本机 API 工具实际上是如何在底层工作的。如果没有,可以阅读 zmq_socekt_monitor() 调用下的本机 API 实现如何设置另一层 ZeroMQ 管道和管道,以便能够监控自己的活动(事件等)并审查,Windows(本机或虚拟平台)如何应对使用 inproc://-channels setup among your Context()-instance(s)' pool-of-IOthread(s) 和上述的一群蜜蜂。尝试调整 IO 线程的数量,并且可能以不同的方式更好地映射 ZMQ_AFFINITY,以便拆分“背景“工作量

...
Each call to this method creates a ZMQ_PAIR socket and binds that to the specified inproc:// endpoint. To collect the socket events, you must create your own ZMQ_PAIR socket, and connect that to the endpoint.

The events argument is a bitmask of the socket events you wish to monitor, see Supported events below. To monitor all events, use the event value ZMQ_EVENT_ALL.

Each event is sent as two frames. The first frame contains an event number (16 bits), and an event value (32 bits) that provides additional data according to the event number. The second frame contains a string that specifies the affected TCP or IPC endpoint.

这是我怀疑 #1250 [ms] 节奏下看到 ~ 100[MB/s] 流量的根本原因,如上所述 (没有 MCVE,因为你上面已经解释过了)。

打开所有可能的事件(在群体中)可能确实会产生一定的流量,因为每个 FSA 事件自启动以来都会报告一个 colourfull 状态,而不管预期的 PUB/SUB + REQ/REP 可扩展的正式通信原型模式'状态,涵盖所有预期的 ZeroMQ 基础设施的连接生命周期,在 { setup | operations | termination | release}-phase:

的任何一个期间传播每个这样配置的监控事件
{ ZMQ_EVENT_CONNECTED,
  ZMQ_EVENT_CONNECT_DELAYED,
  ZMQ_EVENT_CONNECT_RETRIED,
  ZMQ_EVENT_LISTENING,
  ZMQ_EVENT_BIND_FAILED,
  ZMQ_EVENT_ACCEPTED,
  ZMQ_EVENT_ACCEPT_FAILED,
  ZMQ_EVENT_CLOSED,
  ZMQ_EVENT_CLOSE_FAILED,
  ZMQ_EVENT_DISCONNECTED,
  ZMQ_EVENT_MONITOR_STOPPED
  }

所以数据甚至在第一个预期的 ZeroMQ 基础设施 .connect() 出现之前就已经流动了。


结语:

如果在 L3+ 网络层上也报告了上述 [GB/s] 流,SIGINT 专家最好要求平台供应商进行尽职调查和澄清( s),这种平台的自我报告(即使不是后门 class )做法背后的原因,可以解释,当然 - 最好停止,如此显着的网络出口数据流。 有人敢说平台可能被黑了吗?好吧,希望没有。