[zeromq-dev] ZMQ_ROUTER internals

A. Mark gougolith at gmail.com
Tue Sep 3 18:33:51 CEST 2013


Thanks,

I have an MPMC queue based on ZMQ_ROUTER/inproc as a broker which works
beautifully and without any need for barriers. I'm happy with the
performance for relatively low number of P/C and resources. However I did
notice that with large number of resources and larger number of workers it
does accumulate some latency. I don't have specific results yet to show
though. If it uses std:map it should be O(logN) and should be close to the
performance for low N of a hash lookup O(1). I will gather need to gather
some more data and see what the results are. Also for my app I don't need
to handle very large number of workers/resources so it should be ok.

Mark


On Tue, Sep 3, 2013 at 12:23 AM, Pieter Hintjens <ph at imatix.com> wrote:

> The keys are short numbers. I've not seen a profile of the cost of
> using router sockets that shows any hotspots. This would be worth
> doing before any real discussion of performance. Otherwise it's just
> speculation.
>
> -Pieter
>
> On Tue, Sep 3, 2013 at 9:03 AM, Ian Barber <ian.barber at gmail.com> wrote:
> > It's a std:map with an optimised key type for comparisons. All be equal,
> > shorter should be slightly better, though I can't imagine there's a great
> > deal in it.
> >
> >
> > On Tue, Sep 3, 2013 at 2:41 AM, A. Mark <gougolith at gmail.com> wrote:
> >>
> >>
> >> I hope I'm not asking a redundant question and I haven't the time to
> look
> >> at the ZMQ source code at the moment. What is the underlying search
> method
> >> for routing messages internally within ZMQ_ROUTER? Assuming it's a
> perfect
> >> hash - or at least it's some kind of hashing algo based on identity, I
> >> assume using smaller length identity somewhat reduces the overhead of
> >> routing? Aside from that I'm wondering is there any other precaution to
> take
> >> if one wants to have a very tightly bound lowest latency router (broker)
> >> over inproc?
> >>
> >>
> >> Any input is appreciated.
> >>
> >>
> >> Mark
> >>
> >> _______________________________________________
> >> zeromq-dev mailing list
> >> zeromq-dev at lists.zeromq.org
> >> http://lists.zeromq.org/mailman/listinfo/zeromq-dev
> >>
> >
> >
> > _______________________________________________
> > zeromq-dev mailing list
> > zeromq-dev at lists.zeromq.org
> > http://lists.zeromq.org/mailman/listinfo/zeromq-dev
> >
> _______________________________________________
> zeromq-dev mailing list
> zeromq-dev at lists.zeromq.org
> http://lists.zeromq.org/mailman/listinfo/zeromq-dev
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.zeromq.org/pipermail/zeromq-dev/attachments/20130903/6620f93d/attachment.htm>


More information about the zeromq-dev mailing list