[zeromq-dev] Message batching in zmq
Francesco
francesco.montorsi at gmail.com
Mon Aug 12 11:36:26 CEST 2019
Hi Doron,
Il giorno dom 11 ago 2019 alle ore 15:14 Doron Somech
<somdoron at gmail.com> ha scritto:
> Actually, zeromq is not waiting for buffers to be filled, the engine batch as much messages as possible (or until the buffer is full).
>
> If msg is larger than the buffer the message will be sent as is, using the message own buffer (zerocopy can benefit here as well).
> We will have to free the message buffer or continue batching only after the kernel free the buffer.
ok, thanks for the clarification. I guess that what you are describing
is the code at
zmq::stream_engine_base_t::out_event()
right?
It's not totally clear to me by reading that code but I'm no way
expert of ZMQ internals :)
I just wonder if I can get some statistics of how much batching is ZMQ
actually doing... my feeling is that it's not doing much... because as
I wrote in my other email: if ZMQ engine is indeed waiting to batch up
to 8KB of data before going down the Linux kernel stack via send()
API, all the difference between sending 256B frames and 8KB frames is
just the overhead of ZMQ engine for doing that batching?
Thanks,
Francesco
More information about the zeromq-dev
mailing list