web-applicationsnginxwebservermongrel2

Mongrel2 vs. NGINX+ZeroMQ?


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)


Solution

  • 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! =)