[zeromq-dev] zeromq routing branch request-response example

Iraklis Kourtidis ikourtid at yahoo.com
Wed May 13 21:13:09 CEST 2009


Hi all,

Summary: 
a. I figured out how to get a simple example running in Windows, so I'm posting my findings for those who are completely clueless & starting out from scratch (i.e. me).

b. I can't get the simple example to do more than ~7,000 messages per second, so I'm asking for suggestions.

---

Details:
a.

I have been trying to compile in Windows the simplest example I could find. Martin was kind enough to point me to this:

http://lists.zeromq.org/pipermail/zeromq-dev/2009-May/000776.html

newbies like me, keep in mind that
1. 'eth0' won't work; I got the test to run using my local IP address.
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. Anyway, I downloaded the source code, started from the Microsoft Visual Studio solution file & added zprr.cpp and zrr.cpp in 2 separate projects under the solution, and made those depend on the libzmq project, which I guess means you don't have to specifically link the lib. Anyway, it magically works. I would expect no less from an OS that instead of "find . -name" gives you a floppy-eared dog to search for files. But I digress.

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. 



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.

Regards,
Iraklis
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: zprr.cpp
URL: <https://lists.zeromq.org/pipermail/zeromq-dev/attachments/20090513/aa5f2834/attachment.ksh>
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: zrr.cpp
URL: <https://lists.zeromq.org/pipermail/zeromq-dev/attachments/20090513/aa5f2834/attachment-0001.ksh>


More information about the zeromq-dev mailing list