Java 多服务器聊天
我想用java制作一个聊天服务器,但我不知道这是否是一个好主意,因为我不明白它可以处理的最大用户数是多少......
我正在使用NIO
I would like to make a chat server in java, but I don't know if it's a good idea, because I can't understand what is the maximum of the users of which can handle...
I'm using NIO
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我不知道您对第三方产品的立场,但 Jabber 始终是一种选择,并且已经过一些业界最大的网站的尝试和测试。它是一个兼容 XMPP 的服务器,可以处理集群、负载平衡等事务。
I don't know your stance on third-party products, but Jabber is always an option and has been tried and tested by some of the industry's biggest sites. It's an XMPP-compliant server and can handle things like clustering, load-balancing, etc.
典型的 IO 或 NIO 服务器可以使用 Java 6 处理 1K 到 10K 的并发连接。NIO 对最大连接的影响并不像 Java 1.4 那样大。假设聊天量很小,您应该能够在中等服务器上达到 10K。
如果您只需要 1K 连接,我会使用 IO,因为这往往更容易使用并且可以完成工作。
A typical IO or NIO server can handle between 1K and 10K concurrent connections with Java 6. NIO doesn't make as much difference to the maximum connections as it did with java 1.4. Assuming that the chat is light weight you should be able to reach 10K on a modest server.
If you just need 1K connections, I would use IO as this tends to be simpler to use and will do the job.