创建 Comet/Push 网络服务器的最佳方式?

发布于 2024-08-26 19:46:34 字数 45 浏览 11 评论 0原文

我需要创建一个彗星服务器。

我必须使用哪些网络服务器+模块?

I need to create a comet server.

What webserver + modules do I have to use ?

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

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

发布评论

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

评论(2

离鸿 2024-09-02 19:46:34

Here's a short list of COMET solution I tried, with pros and cons:

  • Python Twisted:基于Python的非阻塞服务器。不幸的是,它“吃掉”了很多CPU并且扩展性不是很好;
  • Jetty:非常好,如果您不需要提供更多服务同时有超过 10k 客户端。 Jetty 每 10k 活跃用户消耗约 2GB 内存;
  • Apache Tomcat:与 Jetty 相同的问题 - 占用大量内存;
  • Apache Mina:NIO框架(非阻塞IO)。没有很好的记录,并且存在扩展问题;
  • JBoss Netty:基于 Apache Mina 的 NIO 框架。文档也很薄弱,但与上述解决方案相比显示出最佳性能。使用 Netty,您可以一次提供约 100k 个连接,消耗几 GB 内存并使用约 20% 的 CPU(4 核);

所以我强烈建议你浏览一下 Netty。

Here's a short list of COMET solution I tried, with pros and cons:

  • Python Twisted: Non-blocking server based on Python. Unfortunately, "eats" a lot of CPU and doesn't scale very good;
  • Jetty: Very good, if you doesn't need to serve more than 10k clients simultaneously. Jetty consumes ~2GB memory per 10k active users;
  • Apache Tomcat: The same problems as with Jetty - eats lots of memory;
  • Apache Mina: NIO framework (non-blocking IO). Is not documented very well, and has problems with scaling;
  • JBoss Netty: NIO framework based on Apache Mina. Has a weak documentation, as well, but shows the best performance compared to aforementioned solutions. With Netty you can serve ~100k connections at a time, consuming several gigabytes of memory and using ~20% CPU (4-core);

So I strongly recommend you glancing over Netty.

千里故人稀 2024-09-02 19:46:34

请不要投票给我,但是你考虑过 Nginx 的推送模块吗?

http://pushmodule.slact.net/

Please do not vote me down, but have your considered about Nginx's push module?

http://pushmodule.slact.net/

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