[zeromq-dev] A simple Request-Reply architecture is much slower than expected.
A. Mark
gougolith at gmail.com
Sat Apr 13 05:34:08 CEST 2013
Can you supply the entire code? Your dealer and router are running in
separate threads right?
On Fri, Apr 12, 2013 at 7:19 PM, crocket <crockabiscuit at gmail.com> wrote:
> There is "Double Read(String name)" method, and it takes 50~60ms to call
> Read() 1000 times.
>
> I made two message queues that are basically a wrapper around that method.
>
> (Java Client)DEALER <-----> ROUTER <-----> Read()
>
>
> I expected the following code to take within 70ms to read 1000 times, but
> it took 250~410ms.
>
> long start=getTimeInMillis()
> for(int i=0; i<1000; ++i)
> reader.send(name+i)
>
> for(int i=0; i<1000; ++i)
> reader.recv()
> long end=getTimeInMillis()
>
> System.out.println("Milliseconds taken to read 1000 times : " +
> (end-start))
>
> I utilized asynchronous send and recv, but I guess it was slow because
> ROUTER used a strict requst-reply pattern.
>
> I read zguide, and "Figure 38 - Detail of Asynchronous Server" inspired me
> to make a variant.
>
> Java Client <----> DEALER <-----> ROUTER|Proxy|DEALER <----->
> DEALER <-----> Read()
> It's simply an asynchronous server with only one worker.
>
> Would it bring about the speedup that I wish for?
>
> Please join this thread.
>
> _______________________________________________
> 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/20130412/5d5c3661/attachment.htm>
More information about the zeromq-dev
mailing list