OpenFire、HTTP-BIND 和性能

发布于 2024-12-17 18:05:05 字数 188 浏览 2 评论 0原文

我正在考虑启动一个 openfire 服务器并设置一个 strope.js 客户端来连接到它。我担心的是,与直接进行 XMPP 连接相比,使用 http-bind 可能会降低性能。

谁能告诉我我的担忧是否相关?如果是的话,到什么程度呢?

另一种方法是使用 Flash 代理与 OpenFire 进行所有通信。

谢谢

I'm looking into getting an openfire server started and setting up a strophe.js client to connect to it. My concern is that using http-bind might be costly in terms of performance versus making a straight on XMPP connection.

Can anyone tell me whether my concern is relevant or not? And if so, to what extend?

The alternative would be to use a flash proxy for all communication with OpenFire.

Thank you

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

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

发布评论

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

评论(4

抱着落日 2024-12-24 18:05:05

BOSH 比普通 XMPP 更详细,尤其是在空闲时。空闲的 BOSH 连接可能每分钟大约有 2 个 HTTP 请求,而正常的连接可能会空闲数小时甚至数天而不发送单个数据包(理论上,实际上,您将拥有 ping 和 keepalive 来对抗 NAT 和损坏的防火墙) 。

但是,唯一真正了解的方法是基准测试。根据您的使用案例以及您的客户正在(将)做什么,差异可能可以忽略不计,也可以忽略不计。

BOSH is more verbose than normal XMPP, especially when idle. An idle BOSH connection might be about 2 HTTP requests per minute, while a normal connection can sit idle for hours or even days without sending a single packet (in theory, in practice you'll have pings and keepalives to combat NATs and broken firewalls).

But, the only real way to know is to benchmark. Depending on your use case, and what your clients are (will be) doing, the difference might be negligible, or not.

装迷糊 2024-12-24 18:05:05

基础知识:

Socket - zero overhead.

HTTP - requests even on IDLE session.

我怀疑你是否会同时拥有 100 万用户,但如果你的目标是它,那么像 http 这样的无连接协议会更好,因为我不确定任何操作系统都可以支持这种连接的套接字量。

另外,您可以将 OpenFire 捆绑在一起,形成一个农场,这样您就可以在那里获得良好的可扩展性。

Basics:

Socket - zero overhead.

HTTP - requests even on IDLE session.

I doubt that you will have 1M users at once, but if you are aiming for it, then conection-less protocol like http will be much better, as I'm not sure that any OS can support that kind of connected socket volume.

Also, you can tie your OpenFires together, form a farm, and you'll have nice scalability there.

方圜几里 2024-12-24 18:05:05

我们使用 Openfire 和 BOSH,在同一个 MUC 频道中有大约 400 个并发用户。
我们注意到 Openfire 会泄漏内存。我们使用了大约 1.5-2 GB 的内存,并且不断出现内存不足异常。
Openfire 的 BOSH 实现也很糟糕。然后我们切换到 punjab ,它更好,但无法解决 openfire 问题。

我们现在使用 ejabberd 及其内置的 http-bind 实现,并且它的扩展性非常好。运行 ejabberd 的服务器上的负载几乎为 0。

目前我们面临的问题是,我们用来处理聊天负载的 5 个网络服务器有时在大约 200 个连接用户时会过载。
我现在正在尝试使用 websockets,但似乎还不起作用。
也许不通过 Apache 重写规则而是直接在负载平衡器/代理上重定向 http-bind 可以解决问题,但我找不到如何执行此 atm 的方法。

希望这有帮助。

we used Openfire and BOSH with about 400 concurrent users in the same MUC Channel.
What we noticed is that Openfire leaks memory. We had about 1.5-2 GB of memory used and got constant out of memory exceptions.
Also the BOSH Implementation of Openfire is pretty bad. We switched then to punjab which was better but couldn't solve the openfire issue.

We're now using ejabberd with their built-in http-bind implementation and it scales pretty well. Load on the server having the ejabberd running is nearly 0.

At the moment we face the problem that our 5 webservers which we use to handle the chat load are sometimes overloaded at about 200 connected Users.
I'm trying to use websockets now but it seems that it doesn't work yet.
Maybe redirecting the http-bind not via Apache rewrite rule but directly on a loadbalancer/proxy would solve the issue but I couldn't find a way on how to do this atm.

Hope this helps.

倾其所爱 2024-12-24 18:05:05

我最终使用了node.js和http://code.google.com/p/node -xmpp-bosh 因为我在通过 BOSH 直接连接到 Openfire 时遇到了一些困难。

我有一个运行 Node.js 的生产站点,配置为代理所有 BOSH 请求,它的工作方式就像一个魅力(大约 50 个并发用户)。到目前为止唯一的缺点:在 Openfire 管理控制台中,您将看不到已连接客户端的实际 IP 地址,只有本地服务器地址会显示为 Openfire 从 Node.js 服务器获取连接。

I ended up using node.js and http://code.google.com/p/node-xmpp-bosh as I faced some difficulties to connect directly to Openfire via BOSH.

I have a production site running with node.js configured to proxy all BOSH requests and it works like a charm (around 50 concurrent users). The only downside so far: in the Openfire admin console you will not see the actual IP address of the connected clients, only the local server address will show up as Openfire get's the connection from the node.js server.

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