IRC Log


Wednesday January 12, 2011

[Time] NameMessage
[00:44] zchrish If I have a PUBSUB system with 3 subscribers that can handle data rates of 10,000 - 20,000 - 30,000 messages per second respectively, how many messages would arrive at the fastest subscriber after 10 seconds? I am asking theoretically of course. This is my next test.
[01:10] zchrish The result of the above test suggests that PUBSUB sets the transmisstion rate to the slowest subscriber; is that correct? If so, that could be a problem for my application if I encounter someone with a dialup or with a zombie subscriber. Is there anything that can be done in these cases?
[01:11] zchrish <test1> was all localhost and the aggregate PUB->FORWARDER->SUB was 72,350 messages per second.
[01:12] zchrish <test2> added an additional endpoint subscriber but across the internet and the aggregate reduced to 27,000 messages per second.
[01:13] zchrish <test2> showed both localhost and remote subscribers completed at the same time
[01:14] zchrish <test2> also had a couple of occurrances in which the transmission stalled for some seconds which I cannot account since other activities on my system appeared normal.
[01:17] zchrish <test2> both local and remote had correct diffs to the original !
[01:22] zchrish The result of <test2> seems to indicate that PUBSUB uses a global queue for its messaging system which is probably obvious but I haven't dug into the source code to find out. I wanted to be a user for awhile to see how it operates first.
[01:23] zchrish Seems like one item on the to-do list is to implement per-subscription queueing to improve transmission rates for faster channels. I am too naive to know what additional complexity that requires...
[02:19] potatodemon Howdy Y'all! Can zeromq listen as a normal TCP socket? I have a lot of clients using normal sockets that I want to all connect to the zeromq server at once. Is that something zeromq is good for ?
[03:08] potatodemon It looks like zeromq does not do normal sockets, http://lists.zeromq.org/pipermail/zeromq-dev/2010-September/006344.html is that correct ?
[03:08] jugg http://www.zeromq.org/intro:read-the-manual
[03:27] potatodemon How many queues can I have with 0mq on a machine with a gig of ram?
[04:06] cremes potatodemon: you could probably figure this out on your own by writing a little app that spawns a bunch of sockets
[04:07] cremes make sure you bump up the number of file descriptors available to your process or it will run out pretty quickly
[04:07] cremes also, i think 0mq defaults to 512 max sockets; you need to change that in the source and recompile
[04:29] benoitc hi all
[04:29] benoitc how stable is erlzmq actually ?
[07:23] sustrik snidely: what libraries?
[07:43] potatodemon Hey Y'all anyone in here know a lot about the Python ZMQ lib ?
[07:44] guido_g dont't as meta-questions, just ask the question and wait
[07:46] potatodemon I just wanted to know if anyone has used the Python ZMQ lib with the Python gevents lib.
[07:48] potatodemon I am trying to write a simple normal bsd sockets to 0mq data proxy
[07:49] guido_g s0undt3ch had something like this yesterday
[07:49] potatodemon Or find a good, fast one
[07:49] guido_g you could do it w/ pyzmq.eventloop
[07:51] potatodemon Will that give me a async socket server ?
[07:51] potatodemon I think it does. Do you know any examples -- this is new to me.
[07:52] guido_g http://zeromq.github.com/pyzmq/index.html#using-pyzmq
[07:59] potatodemon Cool, a good place to start. Thanks
[08:22] CIA-21 zeromq2: 03Neale Ferguson 07master * r7051387 10/ (AUTHORS configure.in src/Makefile.am src/clock.cpp):
[08:22] CIA-21 zeromq2: Support dynamic generation of C preprocessor definitions for PGM rather than hardcoding them.
[08:22] CIA-21 zeromq2: Signed-off-by: Neale Ferguson <neale@sinenomine.net> - http://bit.ly/fPnk1c
[08:41] codebeaker 2
[08:45] codebeaker sorry, morning all - someone was kind enough to help me out last night, but had another quick query - with the code from github.com/PatrickCheng/zeromq2 - there are missing build instructions, specifically for using that in my own project which is built iwith cmake
[08:47] sustrik welll, with cmake you are probably on your own, it's not part of the official project and there's little knowledge of it; you can possibly to address patrick cheng directly...
[08:57] codebeaker ahh, thanks sustrik -
[08:58] codebeaker I *think* to be honest, this is something that would be easier if I knew about CMake - I want my build to automatically compile the ZMQ target, but I cna't work out how - and Patrick didn't write any docs :)
[08:59] benoitc erlzmq version using rebar : https://github.com/benoitc/erlzmq/tree/rebar
[08:59] benoitc if it helps someone
[08:59] benoitc how do you guys handle persistence with zmq ?
[09:03] codebeaker benoitc: as far as I understand, that's completely up to tiy
[09:03] codebeaker to you* since I believe you can guarantee that if the message is not sent, then it's not sent - and you should persist it
[09:06] benoitc mmm right
[09:06] codebeaker ^^ :) HTH
[09:07] benoitc want ot use the possibility of zmq to load balance messages with push/pull instead of simply using redis and jhandle manually suscription
[09:07] benoitc +s
[09:07] benoitc maybe i will just use both
[09:42] si14 hi all. Is anybody there?
[09:49] si14 I'm trying to make a zeromq, but I've got a lot of errors like this
[09:49] si14 /usr/include/c++/4.4/bits/stl_vector.h:434: error: ‘__gnu_cxx::__normal_iterator<typename std::_Vector_base<_Tp, _Alloc>::_Tp_alloc_type::const_pointer, std::vector<_Tp, _Alloc> > std::vector<_Tp, _Alloc>::begin()’ cannot be overloaded
[09:50] si14 in fact it's something like this (it's not my log, but this one is very similar to mine): https://gist.github.com/700285
[09:54] si14 ah, sorry, I've found the solution here: http://travlr.github.com/zmqirclog/2010-November.html
[09:56] sustrik sil4: if you find the website not addressing this problem, feel free to adjust it
[09:56] sustrik it's a wiki
[12:37] s0undt3ch guido_g: remeber my problem fom yesterday? here's a sucessfull attempt with zmq.eventloop using 2.1.0, 2.0.10 does not have zmq.devices, so I couldn't test it -> http://paste.pocoo.org/show/319395/
[12:37] s0undt3ch guido_g: now I have to narrow down what went wrong on my previous attemps using gobject and eventlet io loops
[13:22] s0undt3ch zchrish: you confirmed that the pub/sub io is as slow as the slowest client right?
[13:28] zchrish sOundt3ch: No, according to sustrik this is not the case. The cause of throughput drop is by the use of unicast and the throughput drops linearly with the number of subscribers.
[13:28] s0undt3ch zchrish: pub sub uses unicast?
[13:30] s0undt3ch zchrish: or you were using unicast on you pub/sub sockets?
[13:30] s0undt3ch ah, tcp is unicast
[13:31] zchrish sOundt3ch: My testing was using tcp. There exists pgm/epgm but I have no experience with it.
[13:32] s0undt3ch zchrish: for now I'm using local unix sockets, but I might need to use tcp at a latter stage...
[13:33] s0undt3ch zchrish: anyway, Thanks, was just wondering...
[13:35] zchrish sOundt3ch: My application is designed to be transported through the internet so I am concerned with latency and throughput issues. Still don't have enough experience with 0mq to know how robust it will be to this but I like what I see so far.
[15:47] yawn any advice on jzmq error handling?
[15:47] yawn it tends to die from assertions and being jni i have no obvious way to handle those
[16:15] efhache hi everybody... I need some help with a cross-compiled(arm) library under linux 2.4
[16:16] efhache I've previously compiled the library, codded and work fine under a linux 2.6 but now with a kernell 2.4, I obtain an error as Function not implemented epoll_fd != -1 (epoll.cpp:40) Aborted
[16:16] efhache May be is it possible to configure and recompile the library with an other sort of poolling?
[16:19] mikko yawn: what sort of assertions?
[16:19] mikko and which version of libzmq?
[16:19] efhache zmq 2.0.7
[16:19] yawn mikko: different assertions really. i have not yet collected all of them, last one was Assertion failed: (s), function get_socket, file Socket.cpp, line 467.
[16:20] mikko efhache: can you test with 2.1.0 ?
[16:20] yawn mikko: version is 2.0.10 from brew
[16:20] mikko i remember there is an issue with using epoll on linux even if it's not available
[16:20] yawn mikko: env is mac os x, snow leopard
[16:20] mikko yawn: can you test with 2.1.0 ?
[16:20] mikko 2.1.0 is where active development happens currently
[16:21] mikko so it would be helpful to see if those have been sorted out already
[16:21] efhache miko : not really All the code developped was based on an zmq 2.0.7 version
[16:21] yawn mikko: sure. but the large variety of errors makes me a bit nervous since there really seems to be no way of "catching" those errors. the jvm simply dies as soon as something crashes in the zmq api.
[16:21] yawn mikko: that's why i'm asking about error handling
[16:22] mikko yawn: yes, that's what assertion causes. large chunk of those have been sorted out and we are fixing them as we bump into new ones
[16:22] mikko efhache: i can check this evening as you should probably use poll rather than epoll with 2.4
[16:23] yawn mikko: ok. i have not much experience with jni at all but is there some kind of mechanism that would prevent the jvm from dying?
[16:23] efhache ok I'll back to you tomorow
[16:23] yawn mikko: or is there a flag that changes the assertion behaviour in zmq?
[16:23] yawn mikko: compile-time flag
[16:23] mikko efhache: sure
[16:23] mikko yawn: yes, but those are not properly handled in that case
[16:24] efhache mikko: I'll search again this evening, thw
[16:24] mikko yawn: you can specify -DNDEBUG iirc
[16:24] yawn ok
[16:25] mikko yawn: it would be helpful if you can give 2.1.0 a spin
[16:25] yawn mikko: i'll try to update zmq and compiling with DNDBUG (or whatever the flags name is).
[16:25] mikko yawn: try without the flag first
[16:25] mikko yawn: as i said 2.1.0 fixes a lot of the assertions
[16:25] mikko yawn: and if you run into assertions in normal usage we would like to sort those out as well
[16:26] yawn mikko: i think that most of the problems occur when inproc sockets with multipart messages terminate before the message is complete
[16:26] mikko yawn: do you code C ?
[16:26] mikko C test case would be a huge help (java should be ok as wlel but takes a bit longer to process)
[16:27] yawn mikko: no, it's a java project
[16:27] mikko if you can wait a couple of hours for me to get home i can test this on 2.1.0
[16:27] mikko i dont have java bindings running but shouldnt take long to get them
[16:28] mikko and as it's JNI java test case should be fairly valid as well
[16:28] yawn mikko: test data is a bit problematic since it's driven by real world data. plus the server that interfaces with zmq is evented - so i usually have no idea at all what exactly caused the assertion.
[16:28] mikko ok
[16:28] yawn real world data = totally volatile stuff
[16:28] mikko you can have the process to core dump on assertion
[16:28] mikko and run it in debugger
[16:28] mikko but i would recommend testing with 2.1.0 as the first step
[16:28] yawn i'll do that first
[16:29] yawn when it's still dying i'll try to send you a dump
[16:34] yawn mikko: damn, 2.1.0 is not yet on brew ... :-)
[16:35] mikko brew is something like macports?
[16:56] zchrish In the PUBSUB pattern, is there a way for the publisher to know something about the subscriber set?
[16:57] zchrish like subscriber IPs.
[16:59] Vince my wrapper has been throwing this message at me today "Operation cannot be accomplished in current state" anyone seen that before? This happens with zmq_recv()
[16:59] zchrish If not, I suppose it could be easy enough to broadcast a call-in message which causes the subscriber set to respond.
[17:00] Vince Seems the actual point which throws this error is here:
[17:00] cremes zchrish: no, it's not possible because that kind of information doesn't fit into the pub/sub pattern
[17:00] Vince // In blocking scenario, commands are processed over and over again until // we are able to fetch a message. while (rc != 0) { if (errno != EAGAIN)
[17:00] cremes zchrish: use a separate pair of sockets to share that information
[17:00] Vince whats a blocking scenario? How do I over come it?
[17:00] cremes Vince__: that is happening with a req/rep pair, yes?
[17:00] zchrish OK; thanks.
[17:01] Vince yes
[17:01] cremes Vince__: you need to call send/recv/send/recv in that pattern for each one; you must be trying to call send/send or recv/recv somewhere
[17:01] cremes which violates the request/reply state machine
[17:02] potatodemon Are pyzmq zmq socket sends non-bocking ?
[17:02] Vince recv/recv on a server demo in a loop........ I guess that was wrong then
[17:02] cremes Vince__: yep, that's wrong
[17:02] cremes potatodemon: i doubt sends are nonblocking by default; there is likely a flag you can pass to make it so
[17:02] cremes otherwise it blocks by default
[17:03] Vince Seems like I need to rethink the design then
[17:03] Vince the server won't be sending anything usually though so now I'm confused...
[17:03] cremes Vince__: tell us what you are trying to do and we can probably make suggestions
[17:05] Vince I wrote a wrapper for a basic language that not many people use (blitz) it needed safe types so I wrote an addition to the ZMQ API to use safe types as well. Everything seems to be fine except for this issue. I created a server in basic that right now has zmq_recv() running in a while loop. Obviously thats not right.
[17:05] cremes Vince__: explain what the client is supposed to do and what the server is supposed to do
[17:06] Vince server recieves messages from client and sends it to other clients
[17:06] Vince pretty simple
[17:06] cremes and what does the client do?
[17:07] cremes send requests only?
[17:07] Vince client sends messages to the server and recieves messages from the server
[17:07] yawn mikko: yes.
[17:07] cremes ok
[17:08] cremes so which one of these (client or server) is currently sitting in a while loop doing recv?
[17:08] Vince server
[17:09] cremes does that server ever need to respond back to the client, e.g. return a result?
[17:09] Vince I was hoping to just let the server sit there and wait for a connection/message from client
[17:09] cremes ok; so does the server ever need to respond back to its clients?
[17:10] cremes i'm trying to understand the message flow.... it's unclear
[17:10] Vince the server needs to communicate messages from ClientA to B,C,D,E,F etc... the server doesn't need to talk back to the client that connected. All I need to know is if the client connected successfully.
[17:10] cremes ok
[17:11] cremes do clients B,C,D,etc need to respond to A or is the message flow uni-directional?
[17:11] cremes that is, A only ever sends and never receives, B,C,D,etc only recv and never send
[17:11] Vince Easiest example I can think of is a game server where the client moves and the movement is sent to all the other clients
[17:12] cremes ok
[17:12] cremes you should look at the pub/sub sockets; req/rep is the *wrong* pattern
[17:12] Vince hmmm
[17:12] cremes client A would have a PUB socket
[17:12] cremes the server would be a FORWARDER device
[17:13] cremes the clients of the server would all have SUB sockets and would subscribe to the topics they want
[17:13] cremes does that make sense?
[17:13] cremes if not, tell me where it's confusing or wrong
[17:14] Vince I guess I need to make sure I understand what you are saying.
[17:14] cremes ok, i'll break it down a bit more
[17:14] cremes client A *only* sends data and never cares about a response to what it sent
[17:15] Vince is there a simple example anywhere?
[17:15] cremes ...
[17:15] cremes did you read the guide linked off of the website?
[17:15] cremes it covers all of these patterns in detail with code
[17:15] Vince Yes I did actually
[17:15] cremes and the PUB section didn't seem appropriate for some reason?
[17:16] Vince It is probably. I just did the tutorials a few weeks ago.
[17:16] Vince Forwarder seems to be throwing me.
[17:17] Vince I am looking at the guide now.
[17:18] cremes forwarder is a pretty simple device... let me see if i can help clarify its use
[17:18] cremes a forwarder device will have a SUB socket and a PUB socket
[17:18] Vince k
[17:18] cremes both sockets will *bind* to some addresses
[17:19] cremes a publisher (client A) connects to the forwarder and sends its messages there
[17:20] cremes subscribers interested in what client A have to say subscribe to the forwarder without needing to know the address of client A
[17:20] Vince aha! thats what I want indeed
[17:20] cremes now along comes client B who *also* wants to publish data to an unknown number of subscribers
[17:20] cremes it also connects to the forwarder and starts publishing
[17:21] cremes a forwarder is a device for linking up multiple subscribers with multiple publishers
[17:21] cremes does this help?
[17:22] cremes the forwarder can be thought of as a way to get "multicast"/spread delivery via tcp
[17:23] Vince so what happens with the forwarder in terms of the application. Do I not need to actively tell it to recv messages?
[17:23] cremes nope
[17:23] cremes take a look at the code in the repository.... it's super simple
[17:24] cremes it essentially sits in a while loop; every time it receives something it immediately sends it out to all subscribers
[17:24] Vince ah
[17:24] Vince I'm starting to think something like
[17:24] Vince zmq_init() // Socket facing clients zmq_socket() // Socket facing services zmq_bind() zmq_socket() // Start built-in device zmq_device()
[17:40] Vince cremes how can I determine if a subscriber connects to the published socket from the server application?
[18:15] cremes Vince__: that information is not exposed by the 0mq library; you would need a separate pair of sockets to transmit that info
[18:15] cremes at the application level
[18:19] Vince thanks for all your help cremes!
[18:19] cremes Vince__: you're welcome
[18:19] Vince pub/sub is certainly what I was looking for
[19:24] mikko good evening
[20:26] mikko sustrik: there?
[20:37] sustrik mikko: hi
[20:39] mikko sustrik: im adding some static analysis tools to builds
[20:39] mikko they might produce some false positives but i guess it's ok
[20:39] mikko http://build.valokuva.org/job/ZeroMQ2-core-master_cppcheck/3/cppcheckResult/?
[20:45] sustrik mikko: nice
[20:45] sustrik let me check the report
[20:47] sustrik mikko: that's the current master?
[20:48] sustrik it looks like there's a bug in cppcheck :)
[20:50] sustrik struct x {}; results in "Redundant code: Found a statement that begins with numeric constant"
[20:51] mikko i could scale down the volume
[20:51] mikko to more critical errors
[20:51] sustrik no need
[20:51] mikko i was thinking about adding a check for trailing whitespace as well
[20:51] sustrik why not
[20:52] sustrik i should maybe report the problem to cppcheck devs...
[20:53] mikko yes, they are on github as well
[20:56] sustrik hm, github? brief search seems to point me to sourceforge
[20:59] mikko https://github.com/danmar/cppcheck
[20:59] mikko at least this is where i cloned it from
[21:00] sustrik probably a mirror
[21:00] sustrik the project itselft seems to live at sourceforge
[21:10] sustrik ok, i've posted a comment on their forum
[21:32] danyamins hi
[21:32] danyamins does anyone here have ideas about using pyzmq to make an asychronous driver for mongodb?
[21:34] guido_g mongodb doesn't speak ømq
[21:34] guido_g so it would be more a proxy then a driver
[21:34] danyamins well
[21:34] danyamins when you say it doesnt speak 0zm, what do you mean?
[21:35] danyamins (sorry for the naive question)
[21:35] guido_g mongodb doesn't understand ømq messages
[21:36] danyamins you mean, there's something about he packing of the bits ?
[21:36] danyamins you have to have it in aparticular form, the things you send over the sockets?
[21:36] guido_g *sigh* yes
[21:37] danyamins how so?
[21:37] danyamins where is that documented?
[21:37] danyamins I mean, undestand that the mongo stuff has to be in a particular form
[21:37] danyamins I've already written a mongodb asynchronous driver
[21:37] danyamins (I was hoping to replace the regular sockets in it with zmq sockets)
[21:38] danyamins (and replace the tornado ioloop i use with the zmq ioloop)
[21:38] mikko danyamins: zeromq frames the messages before sending them over wire
[21:38] danyamins ah
[21:45] danyamins so what is the proper solution?
[21:45] danyamins do I have any options?
[21:45] danyamins that are good?
[21:47] yrashk is there any common reason why this https://gist.github.com/92839a6ab653f9366bb2 might happen?
[21:52] benoitc https://github.com/benoitc/couch_zmq I started a zeromq endpoint for couchdb
[21:54] danyamins could that help with the mongodb project?
[21:55] benoitc no
[21:55] danyamins ok sorry
[22:04] mikko danyamins: you can't easily have zmq to communicate with mongo
[22:04] mikko danyamins: you would need to write a proxy that takes zeromq messages and converts them to something that mongo understands
[22:04] mikko so you are effectively back to square one
[22:05] mikko benoitc: i think i've seen this before
[22:06] mikko or something similar
[22:27] mikko sustrik: http://build.valokuva.org/job/ZeroMQ2-core-master_static-analysis/7/dryResult/?
[22:27] mikko duplicate code checker as well
[22:27] mikko now time to sleep
[22:27] mikko g'night
[23:03] Seta00 how do I check if the other endpoint is running?
[23:05] Seta00 (on a SUB socket)
[23:05] Seta00 if that matters :P
[23:06] neopallium Seta00: you can't with just a SUB socket.
[23:06] Seta00 neopallium, what are my options?
[23:06] neopallium you can create a REQ socket and send a request to the publisher to see if they are running, or just wait for a message on the SUB socket.
[23:07] Seta00 the problem with just waiting is that I can't notify users that the server is not running
[23:07] neopallium the publisher can bind a REP socket, which the subscribers connect with a REQ socket to to ask if they are running.
[23:07] Seta00 so the REQ socket won't wait for the endpoint to come online like a SUB socket?
[23:08] neopallium no, you would have to add some timeout when you send the request over the REQ socket.
[23:08] Seta00 hmm, I wonder how I didn't notice that
[23:09] Seta00 thank you neopallium
[23:09] neopallium np
[23:10] neopallium I just wished 0mq provided a way to register to receive events from the sockets (i.e. like connect/disconnect notices).
[23:11] Seta00 that would be nice :)