i working on building c++ proxy forwarding network packets our upstream python application, , looking performant , reliable solution communicating between proxy , application.
from read on internet, zeromq seems solution performance perspective. not support guaranteed delivery. wondering if there ipc library fit requirements, or if there way use zeromq in hacky way avoid packet loss?
without drilling down details, there 2 aspects:
yes, zeromq give wealth part of both, not expect one-liner ( while python may quite close ). real-time part more sensitive -- c++ part -- may smart , light-weight take minimum resources , care in [proxy]-engine side , up-stream python benefit separation , can enjoy feature-rich post-processing tasks.
performance - zeromq devilish messaging. said, 1 may forget packet , rather start thinking in terms of a-behaviour-related signalling gives developers lot of power our main jobs. written down below, 1 may wish check smart-messaging framework martin sustrik ( co-father of zeromq ) - nanomsg may provide better fits signalling-behaviour patterns direct , fast ipc-signalling project ( guess developers love in-built fsa engines rather tweaking threads/raw-socks/ipc-channels ).
reliability - zeromq powerful horse heterogeneous ( many ports allowing any-to-any message-passing, python, erlang, c++, go alongside content-processing path), massively distributed, ( within reasonable range ) linear scaleable solutions.
guaranteed delivery thing zeromq philosophy strives avoid ( , wisdom lets application's own domain context-aware handling ).
with deeper down details, there nice ipc exception:
for ipc-transport class, there no place lose content. in case setup zeromq infrastructure right on both ends of ipc-transport connected signalling channel, there no chance data-loss. may fine tune zero-copy mode end-points' buffer-allocation(s) / data-manipulation steps further shaving few more usec fact, data stored in memory , need not copied have passed via ipc.
if under real pressure cut more, check nanomsg going step farther ( @ cost of not wide co-developed wrappers, no trouble project defined above ).
Comments
Post a Comment