简体   繁体   中英

Profiling ZeroMQ

Question about ZeroMQ profiling and debugging. I'm interested to find out two information for a 0MQ socket. 1) queue length and 2) the messages (# of messages and total message size).

Is there anyway we can monitor and log the above information in 0MQ sockets? Does 0MQ expose such counters? I think it quite useful for us to profile and debug the system that we build on top of 0MQ. We are using the C++ API. Thanks.

No, AFAIK, this view is not exposed to user-programs. 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.


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.

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 ).

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 ).

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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