提高 BOSH 吞吐量
我使用 Jabber 实现了一个网络聊天系统,Tigase 服务器和基于 Ajax 的客户端使用 JsJac 通过 BOSH 进行通信,Apache mod_proxy 将 HTTP 流量转发到 Tigase。这工作得相当不错,但我注意到与桌面 Jabber 客户端(如 Exodus)相比,性能上存在重大差距,特别是在加入具有较长消息历史记录的多用户聊天时。
具体来说,从监控 HTTP 流量来看,服务器似乎每个 HTTP 请求-响应周期只能发送一条 XMPP 消息。对于正常使用来说,这很好(我们得到大约 80-100 毫秒的往返时间,这还不错),但是当加载 MUC 历史记录时,这可能是一个真正的阻力。
所以我的问题是:Jabber 或 BOSH 是否提供任何可能适用于此用例的捆绑或流式消息机制?是否有任何客户端和服务器已经实现了类似的功能?或者我是否必须自己修改 Tigase 和 JsJac(这当然是可能的,但并不理想)?
I've implemented a web chat system using Jabber, with the Tigase server and an Ajax-based client communicating over BOSH using JsJac, with Apache mod_proxy forwarding the HTTP traffic to Tigase. This works reasonably well, but I've noticed one major gap in performance versus a desktop Jabber client (like Exodus), particularly when joining a multi-user chat with a long history of messages.
Specifically, from monitoring HTTP traffic, it appears that the server can only send one XMPP message per HTTP request-response cycle. For normal usage this is fine (we're getting roughly 80-100msec round-trip times, which isn't too bad), but when loading MUC history it can be a real drag.
So my question is: does Jabber or BOSH provide any mechanism for bundling or streaming messages that might apply to this use case? Are any clients and servers out there implementing something like this already? Or would I have to modify Tigase and JsJac myself (which is certainly possible, but not ideal)?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
实际上,BOSH 服务器可以从 Jabber 服务器收集尽可能多的响应,并将它们作为单个响应发送给客户端。我是这样一个 BOSH 库的作者:http://code.google.com/ p/node-xmpp-bosh/。
对于 BOSH,响应正文与请求正文无关。我的意思是,响应可能而且大部分将是对不相关请求(主要是稍后的请求)的响应。
Actually, the BOSH server can collect as many responses from the Jabber server and send them as one single response to the client. I am the author of one such BOSH library: http://code.google.com/p/node-xmpp-bosh/.
The response body has nothing to do with the request body in case of BOSH. I mean that the response could and mostly will be a response to an unrelated request (mostly a later request).
我已经在服务器上使用 Java 并在客户端(浏览器)上使用 GWT 实现了 BOSH 通信解决方案。 AC 客户端也已实现。目前,我正在将该解决方案提供在线测试。请查看以下 Google 演示文稿,看看我的解决方案是否适合您的业务:
https://docs.google.com/present/edit?id=0AUPL-u98h45WZGQzNWNjOGhfMGd6bWI1NmNk&hl=en&authkey=CPTzrWc
要查看演讲者备注,请确保点击页面右下角的“查看演讲者备注”按钮。
I have implemented a BOSH communications solution with Java on the server and GWT on the client (a browser). A C client implementation has also been made. Presently, I am in the process of making the solution available online for tests. Please take a look at the following Google presentation to see if my solution is relevant for your business:
https://docs.google.com/present/edit?id=0AUPL-u98h45WZGQzNWNjOGhfMGd6bWI1NmNk&hl=en&authkey=CPTzrWc
To see the speaker notes, make sure you hit the "View Speaker Notes" button in the bottom-right corner of the page.