[zeromq-dev] zeromq routing branch request-response example
Martin Sustrik
sustrik at fastmq.com
Wed May 13 21:39:49 CEST 2009
Hi Iraklis,
> newbies like me, keep in mind that 1. 'eth0' won't work; I got the
> test to run using my local IP address.
Unofortunately, Windows has no reasonable network interface names. Using
IP addresses seems to be the only viable solution.
2. I know this will sounds
> strange. Linking the lib (downloaded in the 0.6 binary set) didn't
> work for me - it caused a crash. Most likely I was doing something
> stupid.
Just a guess: Different CRT library used by the lib and the program?
> 3. zprr.cpp has a line "api->subscribe (qid, sub);" that gives me a
> compiler error. Maybe this is from a previous version of 0mq. Anyway,
> I removed it, and the example still worked.
The example you've used was written for 'routing' branch. 0.6 version
has no routing support and thus no 'subscribe' command. Find the branch
here:
http://svn.fastmq.org/svn/zeromq/branches/routing/
> b.
>
> I was running both the zprr & zrr apps on my windows desktop (Xeon 2
> GHz, 2 Gigs of memory, 8 cores, almost idle machine, low memory
> utilization so no thrashing). I ran in release mode (though debug
> doesn't make a big difference). I then changed the zrr.cpp code so
> that it does something even simpler; it just returns the same exact
> message it received. No constructors or anything remotely
> time-consuming. Basically, both sides were doing an api->send and
> api->receive in a tight loop. I am attaching the modified code.
>
> I couldn't get this to do more than ~7,000 messages per second, even
> though both client and server are on the same machine. That doesn't
> sound right. I know the performance tests on zeromq.org show much
> better numbers than this,so presumably I'm doing something wrong, in
> which case I'd appreciate some feedback.
You are measuring latency rather than throughput. AFAIU the test is a
standard ping-pong program sending a message back and forth in a
lockstep fashion.
As far as I can tell, what you are seeing is 7000 roundtrips per second,
right? If so, it means that one roundtrip takes 143 microseconds i.e.
one-way latency is 71.5 microseconds.
As for the throughput, try perf tests packaged with 0MQ instead:
zmq_server
and
local_thr localhost 127.0.0.1:5555 127.0.0.1:5556 1 1000000
and
remote_thr localhost 1 1000000
Martin
More information about the zeromq-dev
mailing list