Windows server max connections

Windows server max connections

Вопрос

I got a Windows Server 2008 hosting a WCF HTTP service on it. (not through IIS).

I can see using perfmon that the machine can handle around 14,000 connections per second.

How can I increase the number of connections? is there an OS limit?

Ответы

Maximum connections per second in HTTP.sys (HTTP server functionality) will depend on underlying TCP/IP stack. However, you can configure Max Connections (default=infinite): for a URL namespace that a URL namespace can be reached by. If the limit is exceeded a 503 will be sent to the client and disconnect.

You can configure this max connections value from the registry key HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\HTTP\Parameters\MaxConnections. For more information on this and other registry parameters please refer to http://support.microsoft.com/kb/820129.

Please remember to click «Vote As Helpful» on the post if the information is useful to you ! Please remember to click “Mark as Answer” on the post that helps you to fix the issues, and to click «Unmark as Answer” if a marked post does not actually answer your question. This can be beneficial to other community members reading the thread. This posting is provided «AS IS» with no warranties or guarantees and confers no rights.

Max Outgoing Socket Connections in .NET/Windows Server

I have a slightly unusual situation where I’m needing to maintain CLIENT tcp connections to another server for thousands of mobile users on my servers (basically the mobile devices connect to my middle tier server when they are able to, which maintains a more stable connection to the 3rd party server for the mobile devices).

Anyways, I’ve developed my server application using Async Sockets (wrapped up in a SslStream), and have got 1000 client sessions running full time on it right now. I’m quite happy with the results so far as I’m seeing about 0-10% average cpu usage on a single core processor, and about 60mb of ram being used over time.

My question is, how do I scale this up so I can reach 100,000 or 200,000 or more client sessions being run on my server? Again, this is a bit untraditional, as my server isn’t really acting like a server, since I’m worried about outgoing connections, not incoming.

Читайте также:  Сбросить пароль windows regedit

I know that there’s a registry setting MaxUserPort that needs to be changed to get beyond the default which seems to be 5000. However, there seems to be another hard limit of 65535, and I’m not too clear on where that limit resides. Is this a limit per network interface? Is it a global Windows limit? Is it a limit per process?

If it is a limit per network interface, can I add multiple network interfaces and bind client session sockets to each interface (eg: 65k on interface 1, 65k on interface 2, etc.)?

I’m also not too sure what, if any socket options or properties I should be setting to help things out. Right now I’m not using any socket options.

I’d really appreciate any thoughts on this subject, as clear advice has been pretty hard to come by on this subject. Thanks!

Windows server max connections

This forum has migrated to Microsoft Q&A. Visit Microsoft Q&A to post new questions.

Answered by:

Question

I got a Windows Server 2008 hosting a WCF HTTP service on it. (not through IIS).

I can see using perfmon that the machine can handle around 14,000 connections per second.

How can I increase the number of connections? is there an OS limit?

Answers

Maximum connections per second in HTTP.sys (HTTP server functionality) will depend on underlying TCP/IP stack. However, you can configure Max Connections (default=infinite): for a URL namespace that a URL namespace can be reached by. If the limit is exceeded a 503 will be sent to the client and disconnect.

You can configure this max connections value from the registry key HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\HTTP\Parameters\MaxConnections. For more information on this and other registry parameters please refer to http://support.microsoft.com/kb/820129.

Please remember to click «Vote As Helpful» on the post if the information is useful to you ! Please remember to click “Mark as Answer” on the post that helps you to fix the issues, and to click «Unmark as Answer” if a marked post does not actually answer your question. This can be beneficial to other community members reading the thread. This posting is provided «AS IS» with no warranties or guarantees and confers no rights.

Читайте также:  Windows для rpg maker vx ace

Max tcp/ip connections on Windows Server 2008

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).

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.

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.

2 Answers 2

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.

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.

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.html and 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.

Edited to add details from the comment below.

If you’re already thinking of multiple servers I’d take the following approach.

Читайте также:  Идет проверка диска перед загрузкой windows

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 ).

Windows server max connections

This forum has migrated to Microsoft Q&A. Visit Microsoft Q&A to post new questions.

Answered by:

Question

Were running a home grown app on a Windows 2008 R2 Enterprise server. The developemnt team would like to know how many concurrent TCP connections can be made and what is the max allowed open ports? Also is there a way to see this in the registry?

Thank you for your help!

Answers

Max tcp/ip connections on Windows Server 2008

Configure the max limit for concurrent TCP connections

max_user_ports=
on OS before Vista: 3977 (rang 1024-5000)
on OS Vista and later Version: 16384 (rang 49152-65535)

TcpnumConnections = 16,777,214
KeepAliveTime = 7200,000 milliseconds =2 hours

Regards,
Rick Tan

All replies

Thank you for your reply,

I don’t see that registry setting in Windows 2008. Could it be in a different place?

It seems it depends on the edition. Since you are using the Enterprise edition, there shouldn’t be any limit on the number of active connections.

I have not found specific data for W2K8 R2. On the other hand take into account the following:

1. Even if the specified registry parameter is not used in default registry, it is posssible for some of them to include these in registry and they play the required role.

2. The theoretical limit is one side of problem and the real values are the second. Whenever there is queue for connection resources longer that one, you know that you have a problem.

3. I suggest to got to solution from other side. You expect that you will need a specified number of connections a that is the way to result(s), because you can come to the conclusion, that the only solution is grouping multiple cards and load balancind, teaming,etc are needed. (Performance monitor is your friedn in this game.)

Оцените статью