question

AntonyMaxwin-4065 avatar image
0 Votes"
AntonyMaxwin-4065 asked SunnyQi-MSFT commented

TCP/IP concurrent connections

Hi When the TCP/IP connections reached 500 , the applications get hanged or getting too much slow, and it speed up slowly when the connection count decreases . So what is the maximum connection that we can have in a Windows server2016, is there anyway we can increase the connection count. ![116352-load.jpg][1] [1]: /answers/storage/attachments/116352-load.jpg

windows-10-networkwindows-platform-network
· 1
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Hi,

Just checking in to see if the information provided was helpful.

If yes, you may accept useful reply as answer, if not, welcome to feedback.

Best Regards,
Sunny

0 Votes 0 ·
SunnyQi-MSFT avatar image
0 Votes"
SunnyQi-MSFT answered SunnyQi-MSFT edited

Hi,

Thanks for posting in Q&A platform.

Server is usually fixed to listen on a local port, waiting for a connection request from client. Regardless of address reuse, the local listening port is exclusive even if there are multiple IP on the server side, so only remote IP (i.e. client IP) and remote port (client port) in the server-side TCP connection 4 tuple are variable, so the maximum TCP connection is the number of client IP × the number of client ports, IPv4, regardless of IP address classification and other factors, the maximum number of TCP connections is about 2 of the 32 times (IP number) ×2 of the 16 times (port number), that is, the maximum number of server side stand-alone TCP connections is about 2 of the 48 times.

The above is given the theoretical maximum number of single-machine connections, in the actual environment, by machine resources, operating system and other limitations, especially the sever side, its maximum concurrent tcp connection number is far from reaching the theoretical upper limit. Maximum TCP connections depends on several factors of our Windows server, it's hard to say an accurate number.


If you are using a high number of TCP connections, particularly with a high connect/disconnect rate, you may exhaust the number of available ports as they may all be in the TIME_WAIT state.

There are two actions that can prevent this:

1. Increasing the number of available (ephemeral) ports.

2. Reducing the TIME_WAIT timeout period.


1. Increasing the number of available (ephemeral) ports.

By default, Windows only allocates ephemeral ports in the range 1024 through 4999.

To increase the upper range of ephemeral ports that are dynamically allocated to client TCP/IP socket connections perform the following. You should first save a backup of the registry.

Start the Registry Editor.
Browse to, and then select the following key in the registry:
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters
Create a new DWORD value, or modify the existing value of MaxUserPort to increase the number of ephemeral ports that can by dynamically allocated to clients:
Value name: MaxUserPorts
Value data: <Enter a decimal value between 5000 and 65534>
Save the changes and close the Registry Editor.
Please note: You must restart your computer for this change to take effect.


2. Reducing the TIME_WAIT Timeout Period

This setting determines the length of time that a connection will stay in the TIME_WAIT state before being closed. The default is 240 seconds which on a busy server will limit the maximum connections to around 200/sec. Reducing this setting will increase the maximum connection limit.

Start the Registry Editor.
Browse to, and then select the following key in the registry:
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters
Create a new DWORD value, or modify the existing value of TcpTimedWaitDelay to alter the TIME_WAIT duration:
Value name: TcpTimedWaitDelay
Value data: <Enter a decimal value between 30 and 300 seconds>(I would suggest you configure this value to 30)
Save the changes and close the Registry Editor.
Please note: You must restart your computer for this change to take effect.

Hope this will help you.

Best Regards,
Sunny


If the Answer is helpful, please click "Accept Answer" and upvote it.

Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

AntonyMaxwin-4065 avatar image
0 Votes"
AntonyMaxwin-4065 answered SunnyQi-MSFT commented

HI
Sorry for the late reply
I have tried the answer, But still the server performance is not incresed. It always stuck on the user connection reaches between 500 and 550,
is it possible to allow 1000 concurrent connections to server or it depends on the DB performance .
I have 2 application server( IIS) and One DB server( MSSQL2014), I have problem only with this SQL server, could you please suggest a solution

· 1
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Hi,

Sorry for my delayed response since I didn't receive the notification of this thread.

I noticed that you have opened a new thread about new question. Could you please accept the useful reply as answer to end this thread up? It will encourage the person who help you.

Appreciate your understanding! :)

Best Regards,
Sunny

0 Votes 0 ·