[zeromq-dev] Short-lived processes
Pieter Hintjens
ph at imatix.com
Wed Jan 29 16:06:29 CET 2014
On Tue, Jan 28, 2014 at 11:23 AM, Randall Nortman <rnzmq at wonderclown.net> wrote:
> I need to send zeromq messages from very short-lived processes, and
> I'm wondering how best to go about it. When I say short-lived, I mean
> on the order of 10-20ms (with all messages going to either localhost
> or over a fast LAN, so this is feasible at least in principle).
I did some tests: https://gist.github.com/hintjens/8689783
Very roughly:
- inproc: 323 ms / 1000 handshakes
- ipc: 680 ms / 1000 handshakes
- tcp: 1100 ms / 1000 handshakes
So your fastest option is to connect over ipc:// to some
longer-running process. As Lindley says, you don't need POLLOUT; you
can send and it'll block until the connection is ready.
You cannot rely on a timeout. You have to use a 2-way flow
(dealer-router, usually) and get back an acknowledgment. That'll add a
hundred microseconds or so, but it'll be faster without random delays.
-Pieter
More information about the zeromq-dev
mailing list