Mongrel2 vs. NGINX+ZeroMQ?
Asked Answered
P

2

15

I see this new NGINX+ZeroMQ project on github and am now confused.

What are the feature and scalability differences between Mongrel2 and NGINX+ZeroMQ.

(The reason why I ask is because I'm under the impression Mongrel2 was solely created since NGINX didn't support ZeroMQ)

Pachysandra answered 6/1, 2012 at 22:36 Comment(0)
B
32

I also read about the nginx+zeromq module and I immediately spotted a considerable difference.

ZeroMQ nginx module uses REQ/REP sockets to communicate with the backend processes. On the other hand mongrel2 uses two sockets. One PUSH/PULL to send messages downstream (to the handlers) and one PUB/SUB (to receive responses from handlers). This makes it totally asynchronous. When mongrel2 sends a request to the backend handlers it returns immediately from the zmq_send() call and the response will be received in another socket, anytime later.

Another difference is that mongrel2 is capable of sending the same response to more than one client. Your handler can tell mongrel2 something like this: "Deliver this response to connections 4, 5, 6 and 10, please". Mongrel2 send the connection ID within the message to the handlers.

Hope this helps! =)

Backbreaking answered 7/1, 2012 at 19:26 Comment(0)
P
1

NGINX+ZeroMQ has bugs. 1. It does not work with NGINX 1.5 reason NGINX before doing send to ZMQ server(for that it calls send chain) upstream hook, tests whether connection is valid or not. And it would fail because it has ZMQ socket and not TCP socket as protocol is different it would say its an invalid connection.

  1. There are plenty more like that.

  2. This module does not support keepalive. Not only upstream but even downstream would not work. I am struggling with making keepalive work at downstream.

My recommendation: It would take two man month to implement ZMQ NGINX with keepalive.

Phosphoprotein answered 12/4, 2014 at 6:47 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.