smockron
smockron copied to clipboard
ZeroMQ isn't awesome
ZeroMQ has done a great job so far, but it has a few issues.
- The client library isn't completely trustworthy, and some people (@silas) aren't comfortable with embedding libzmq in nginx.
- A ZeroMQ bound socket can only have a single socket type. The upshot is that port numbers multiply. We already use one port number for gatekeeper->master pubsub traffic (a SUB on the master) and one for master->gatekeeper pubsub traffic (a PUB on the gatekeeper). Directed traffic between individual gatekeepers and the master would require yet another port. I don't want this to happen, so I'm making this issue a blocker of #16.
- The more I get into it, the more the semantics of ZeroMQ aren't quite perfect. For instance, a PUB client connecting to a SUB listen socket will have all of its messages dropped until a round-trip of messages goes through to transmit the subscription(s), and there's no way to get informed of when that happens. The REQ/REP lockstep thing is also less than awesome.
I'm working on a custom UDP protocol to replace ZeroMQ, to hopefully alleviate all of these.
I'm not sure if it was any progress on this issue lately. I'm working to achieve a similar goal with nginx and lua ( via Openresty ), and I'm looking for a UDP multicast message/event system; the premise is that rate limiting doesn't have to be ultra precise but allow some overflow.
- did you experience any issues with zeromq so far ? Is this a choice by preference that people are not comfortable embedding it ?
- did you try running zeromq on a different IP and don't create congestion on the number of opened ports for nginx ? a new IP should give you about 64k extra connections
- Is this problem happening when a new node is added into the game ?
Hi @ddragosd. No, I haven't been able to do make a ton of progress on this lately, other things have intervened. But I do have some work on a branch and I intend to get back to it soon. In answers to your questions:
- The main problem I've encountered is that it's hard to get everything I want to do to fit within the patterns supported by ZeroMQ socket types. I have spoken to a few people who are worried about the possibility of embedding libzmq in nginx though because libzmq is peppered with
assert
s that could bring the server down. - It's not sheer number of sockets I'm worried about, it's conceptual complexity.
- Yes, that's the current problem. When a new node comes online, or an existing one is restarted, it doesn't have information about blocks that are currently outstanding. It needs a way to get that information on startup.
ZeroMQ 4 looks a lot better if I want to resurrect this. In particular, ZMQ_XPUB_WELCOME_MSG could allow disseminating startup information on gatekeeper connect without having to create a new socket type.