Mongrel2 与 NGINX+ZeroMQ?

发布于 2024-12-25 06:08:15 字数 325 浏览 2 评论 0原文

我在 github 上看到这个新的 NGINX+ZeroMQ 项目,现在很困惑。

Mongrel2 和 NGINX+ZeroMQ 之间的功能和可扩展性差异是什么?

(我之所以问这个问题,是因为我觉得 Mongrel2 是因为 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)

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

魔法少女 2025-01-01 06:08:15

我还阅读了有关 nginx+zeromq 模块的内容,我立即发现了相当大的差异。

ZeroMQ nginx 模块使用 REQ/REP 套接字与后端进程进行通信。另一方面,mongrel2 使用两个套接字。一种 PUSH/PULL 用于向下游发送消息(到处理程序),另一种 PUB/SUB(用于接收来自处理程序的响应)。这使得它完全异步。当 mongrel2 向后端处理程序发送请求时,它会立即从 zmq_send() 调用返回,并且响应将在稍后的任何时间在另一个套接字中接收。

另一个区别是 mongrel2 能够向多个客户端发送相同的响应。您的处理程序可以告诉 mongrel2 这样的信息:“请将此响应传递给连接 4、5、6 和 10”。 Mongrel2 将消息中的连接 ID 发送到处理程序。

希望这有帮助! =)

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

帅冕 2025-01-01 06:08:15

NGINX+ZeroMQ 有错误。
1.它不适用于NGINX 1.5,原因是NGINX在发送到ZMQ服务器(因为它调用发送链)上游钩子之前,测试连接是否有效。它会失败,因为它有 ZMQ 套接字而不是 TCP 套接字,因为协议不同,它会说它是无效连接。

  1. 类似的还有很多。

  2. 该模块不支持keepalive。不仅上游,就连下游也行不通。我正在努力使 keepalive 在下游工作。

我的建议:使用 keepalive 实现 ZMQ NGINX 需要两个人月的时间。

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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文