简体   繁体   English

分析ZeroMQ

[英]Profiling ZeroMQ

Question about ZeroMQ profiling and debugging. 有关ZeroMQ分析和调试的问题。 I'm interested to find out two information for a 0MQ socket. 我有兴趣找出两个有关0MQ套接字的信息。 1) queue length and 2) the messages (# of messages and total message size). 1)队列长度和2)消息(消息数和消息总大小)。

Is there anyway we can monitor and log the above information in 0MQ sockets? 无论如何,我们可以在0MQ套接字中监视和记录以上信息吗? Does 0MQ expose such counters? 0MQ是否公开此类计数器? I think it quite useful for us to profile and debug the system that we build on top of 0MQ. 我认为对我们分析和调试在0MQ之上构建的系统很有用。 We are using the C++ API. 我们正在使用C ++ API。 Thanks. 谢谢。

No, AFAIK, this view is not exposed to user-programs. 不,AFAIK,该视图不公开给用户程序。 Why? 为什么?

The reason is that all the ZeroMQ maxims are doing their best to fine-tune internal mechanics so as to leave user-programs as free from the underlying duties as possible and minimise the service overheads and latencies. 原因是所有ZeroMQ准则都在尽力调整内部机制,以使用户程序尽可能摆脱底层职责,并最大程度地减少服务开销和延迟。


If indeed in a need to reach such nice-to haves: 如果确实需要达到如此美好的生活:

One may, either, fork and add these user-side service management-plane layer into the core elements of the ZeroMQ data-pumps. 可以将这些用户侧服务管理平面层分叉并将其添加到ZeroMQ数据泵的核心元素中。

Next possible move is to stay within the as-is core implementation and just make each socket / queue connect and "run"-traffic through a simple, single purpose "gas-meter"-proxy, that would have none other duty, than to count bytes, messages ( and handle all the mechanics of the possible distribution / aggregation patterns the SUT-is using, so as to meter the 1:1 the flow ). 下一个可能的举动是保持在原样的核心实现内,并且仅使每个套接字/队列通过简单的,单一目的的“煤气表”代理进行连接和“运行”-流量,这无非是要计算字节,消息(并处理SUT使用的可能的分发/聚合模式的所有机制,以便对1:1流量进行计量)。

The costs of the former are much higher than of the latter, but the latter adds a way larger portion of end-to-end SUT-skew, as the "inserted" latencies are much higher and resources consumption grows both in ( SPACE ( {RX|TX}-HWM queues + buffers ) and TIME ( thread-count ). 前者的成本比后者高得多,但是后者增加了端到端SUT偏斜的较大部分,因为“插入”延迟高得多,并且资源消耗都在(SPACE({ RX | TX} -HWM队列+缓冲区)和TIME(线程计数)。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM