服务器一次可以处理多少个客户端?

发布于 2024-10-18 01:02:02 字数 265 浏览 2 评论 0原文

我想答案在很大程度上取决于客户端将进行什么样的活动,但假设我想建立一个客户端/服务器架构,它只涉及连接和断开连接。

也就是说,打开一个 TCP 连接并将其保持三个小时。

一次可以有多少个可能的连接是否有硬性限制(由操作系统或协议等设置)?

另外,这会给服务器带来什么开销?如果 10000 个客户端使用 TCP 连接并维持该连接(假设 TCP 有自己的 keepalive 功能)3 小时,服务器是否必须处理除了 keepalive、连接和断开连接操作之外的任何操作?

I suppose the answer would depend a lot on what kind of activities the clients will have, but suppose I want to make a client/server architecture, which only involves of connecting and disconnecting.

That is, opening a TCP connection and maintaining it for, say, three hours.

Is there a hard limit (set by the operating system, or by the protocols etc) on how many possible connections there can be at once?

Also, what overheads will this have on the server? if 10000 clients would connect using TCP and maintain that connection (assuming TCP has its own keepalive functionality) for 3 hours, will the server have to process anything besides keepalive, the connection and disconnection actions?

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

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

发布评论

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

评论(1

影子的影子 2024-10-25 01:02:02

我在这里写了博客: http://www.serverframework .com/asynchronousevents/2010/12/one-million-tcp-connections.html

在 Windows 上,有一些资源限制可能会给您带来问题,但 10,000 个连接很容易。事实上,我已经在规格相当低的虚拟机上运行了超过 70,000 个连接,请参见此处 http://www.lenholgate.com/blog/2005/11/windows-tcpip-server-performance.html 了解详细信息。

最有可能的是,您在代码中所做的操作限制了您可以处理的连接数量,现代操作系统将轻松处理比您在代码中可以处理的连接数量。

I blogged about this here: http://www.serverframework.com/asynchronousevents/2010/12/one-million-tcp-connections.html

On Windows there are some resource limits which might cause you problems, but 10,000 connections is easy. In fact I've run more than 70,000 connections on a pretty low spec VM, see here http://www.lenholgate.com/blog/2005/11/windows-tcpip-server-performance.html for details.

It will, most probably, be what you do in YOUR code that limits the number of connections that you can handle, the modern operating system will easily handle more than you can in your code.

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