.net Windows Server 2008 上的最大 tcp/ip 连接数
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/1636397/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Max tcp/ip connections on Windows Server 2008
提问by zendar
I have .Net service that listens on single port over TCP protocol. Clients connect and then transmit data for some time (from few minutes to several hours).
我有 .Net 服务,它通过 TCP 协议侦听单个端口。客户端连接然后传输数据一段时间(从几分钟到几个小时)。
Is there any limit on number of connections on Windows 2008 server? I did not hit any, since now there is up to 50 users. Plan is to have thousands of users, so I'd like to know if there will be problems in future.
Windows 2008 服务器上的连接数有限制吗?我没有打任何,因为现在有多达 50 个用户。计划是有几千个用户,所以我想知道将来会不会有问题。
Edit:
As Cloud answered, it seems that there are some limits in some versions of Windows Server 2008. Is there any reference on those limits? I tried Google, but it returns articles on limit on half-bound tcp connections.
编辑:
正如 Cloud 回答的那样,似乎在某些版本的 Windows Server 2008 中存在一些限制。是否有关于这些限制的参考?我试过谷歌,但它返回关于半绑定 tcp 连接限制的文章。
回答by Len Holgate
How many thousands of users?
有多少万用户?
I've run some TCP/IP client/server connection tests in the past on Windows 2003 Server and managed more than 70,000 connections on a reasonably low spec VM. (see here for details: http://www.lenholgate.com/blog/2005/10/the-64000-connection-question.html). I would be extremely surprised if Windows 2008 Server is limited to less than 2003 Server and, IMHO, the posting that Cloud links to is too vague to be much use. This kind of question comes up a lot, I blogged about why I don't really think that it's something that you should actually worry about here: http://www.serverframework.com/asynchronousevents/2010/12/one-million-tcp-connections.html.
我过去曾在 Windows 2003 Server 上运行过一些 TCP/IP 客户端/服务器连接测试,并在一个相当低规格的 VM 上管理了 70,000 多个连接。(有关详细信息,请参见此处:http: //www.lenholgate.com/blog/2005/10/the-64000-connection-question.html)。如果 Windows 2008 Server 仅限于小于 2003 Server,我会非常惊讶,恕我直言,Cloud 链接到的帖子太模糊而无法使用。这种问题经常出现,我在博客上写了为什么我真的不认为这是你真正应该担心的事情:http: //www.serverframework.com/asynchronousevents/2010/12/one-million- tcp-connections.html。
Personally I'd test it and see. Even if there is no inherent limit in the Windows 2008 Server version that you intend to use there will still be practical limits based on memory, processor speed and server design.
我个人会测试它并查看。即使您打算使用的 Windows 2008 Server 版本没有内在限制,仍然存在基于内存、处理器速度和服务器设计的实际限制。
If you want to run some 'generic' tests you can use my multi-client connection test and the associated echo server. Detailed here: http://www.lenholgate.com/blog/2005/11/windows-tcpip-server-performance.htmland here: http://www.lenholgate.com/blog/2005/11/simple-echo-servers.html. These are what I used to run my own tests for my server framework and these are what allowed me to create 70,000 active connections on a Windows 2003 Server VM with 760MB of memory.
如果您想运行一些“通用”测试,您可以使用我的多客户端连接测试和关联的回显服务器。详细信息:http: //www.lenholgate.com/blog/2005/11/windows-tcpip-server-performance.html和这里:http: //www.lenholgate.com/blog/2005/11/simple-echo -servers.html。这些是我用来为我的服务器框架运行我自己的测试的东西,这些使我能够在具有 760MB 内存的 Windows 2003 Server VM 上创建 70,000 个活动连接。
Edited to add details from the comment below...
编辑以从下面的评论中添加详细信息...
If you're already thinking of multiple servers I'd take the following approach.
如果您已经在考虑使用多个服务器,我会采用以下方法。
Use the free tools that I link to and prove to yourself that you can create a reasonable number of connections onto your target OS (beware of the Windows limits on dynamic ports which may cause your client connections to fail, search for
MAX_USER_PORT).during development regularly test your actual server with test clients that can create connections and actually 'do something' on the server. This will help to prevent you building the server in ways that restrict its scalability. See here: http://www.serverframework.com/asynchronousevents/2010/10/how-to-support-10000-or-more-concurrent-tcp-connections-part-2-perf-tests-from-day-0.html
使用我链接到的免费工具并向自己证明您可以在目标操作系统上创建合理数量的连接(注意 Windows 对动态端口的限制,这可能会导致您的客户端连接失败,搜索
MAX_USER_PORT)。在开发过程中,定期使用测试客户端测试您的实际服务器,这些客户端可以创建连接并在服务器上实际“执行某些操作”。这将有助于防止您以限制其可扩展性的方式构建服务器。请参阅此处:http: //www.serverframework.com/asynchronousevents/2010/10/how-to-support-10000-or-more-concurrent-tcp-connections-part-2-perf-tests-from-day-0 .html
回答by pyrocumulus
There is a limit on the number of half-open connections, but afaik not for active connections. Although it appears to depend on the type of Windows 2008 server, at least according to this MSFT employee:
半开连接的数量有限制,但对于活动连接则不然。尽管它似乎取决于 Windows 2008 服务器的类型,但至少根据这位 MSFT 员工的说法:
It depends on the edition, Web and Foundation editions have connection limits while Standard, Enterprise, and Datacenter do not.
这取决于版本,Web 和 Foundation 版本有连接限制,而 Standard、Enterprise 和 Datacenter 没有。

