[zeromq-dev] A simple Request-Reply architecture is much slower than expected.
crocket
crockabiscuit at gmail.com
Sat Apr 13 09:32:08 CEST 2013
DEALER is running in a java process, and ROUTER is running in LabVIEW which
is a graphical programming language.
A LabVIEW process reads a variable name from a ROUTER socket and reads that
variable with Read().
The retrieved value is sent back through the same ROUTER to the DEALER
socket that requested the value.
Until next monday, I don't have access to those codes since the codes are
in my company computer.
On Sat, Apr 13, 2013 at 12:34 PM, A. Mark <gougolith at gmail.com> wrote:
> 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
>>
>>
>
> _______________________________________________
> 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/20130413/a1d3d6fc/attachment.htm>
More information about the zeromq-dev
mailing list