- Configure the max limit for concurrent TCP connections
- Как увеличить порог TCP-соединений?
- What is the theoretical maximum number of open TCP connections allowed on a Windows server [closed]
- 2 Answers 2
- Max tcp/ip connections on Windows Server 2008
- 2 Answers 2
- Which is the maximum number of Windows concurrent tcp/ip connections?
- 4 Answers 4
Configure the max limit for concurrent TCP connections
To keep the TCP/IP stack from taking all resources on the computer, there are different parameters that control how many connections it can handle. If running applications that are constantly opening and closing connections (P2P), or are providing a service which many tries to connect to at the same time (Web-server like IIS), then one can improve the performance of these applications by changing the restriction limits.
There is a parameter that limits the maximum number of connections that TCP may have open simultaneously.
[HKEY_LOCAL_MACHINE \System \CurrentControlSet \Services \Tcpip \Parameters]
TcpNumConnections = 0x00fffffe (Default = 16,777,214)
Note a 16 Million connection limit sounds very promising, but there are other parameters (See below), which keeps us from ever reaching this limit.
[HKEY_LOCAL_MACHINE \System \CurrentControlSet \Services \Tcpip \Parameters]
MaxUserPort = 5000 (Default = 5000, Max = 65534)
Note it is possible to reserve port numbers so they aren’t used as dynamic ports in case one have a certain application that needs them. This is done by using the ReservedPorts (MS KB812873) setting.
Note Vista changes the default range from 1024-5000 to 49152-65535, which can be controlled with the dynamicport setting using netsh. More Info MS KB929851.
[HKEY_LOCAL_MACHINE \System \CurrentControlSet \Services \Tcpip \Parameters]
MaxFreeTcbs = 2000 (Default = RAM dependent, but usual Pro = 1000, Srv=2000)
[HKEY_LOCAL_MACHINE \System \CurrentControlSet \services \Tcpip \Parameters]
MaxHashTableSize = 512 (Default = 512, Range = 64-65536)
Note Microsoft recommends for a multiprocessor environment, that the value should not be higher than the maximum amount of concurrent connections (MaxFreeTcbs), also if multiprocessor then it might be interesting to look at the registry-key NumTcbTablePartitions (Recommended value CPU-count multiplied by 4).
[HKEY_LOCAL_MACHINE \System \CurrentControlSet \services \Tcpip \Parameters]
TcpTimedWaitDelay = 120 (Default = 240 secs, Range = 30-300)
Note with Win2k the reuse of sockets have been changed, so when reaching the limit of more than 1000 connections in TIME-WAIT state, then it starts to mark sockets that have been in TIME_WAIT state for more than 60 secs as free. It is possible to configure this limit:
[HKEY_LOCAL_MACHINE \System \CurrentControlSet \services \Tcpip \Parameters]
MaxFreeTWTcbs = 1000 (Default = 1000 sockets)
Note with Win2k3 SP1 the reuse of sockets have been changed, so when it has to re-use sockets in TIME_WAIT state, then it checks whether the other party is different from the old socket. Eliminating the need to fiddle with (TcpTimedWaitDelay) and (MaxFreeTWTcbs) any more.
[HKEY_LOCAL_MACHINE \System \CurrentControlSet \services \Tcpip \Parameters]
KeepAliveTime = 1800000 (Default = 7,200,000 milisecs)
When data is sent/received the data is copied back and forth to non-paged pool memory for buffering. If there are many connections receiving/sending data, then it is possible to exhaust the non-paged pool memory. The max size of the non-paged pool buffer allocated for each connection is controlled by MaxBufferredReceiveBytes or TCPIP Receive Window depending on which is smallest. More Info MS KB296265
Note if using the Professional/Home edition of Windows then it is very likely that it is crippled (By Microsoft) not to handle many concurrent TCP connections. Ex. Microsoft have officially stated that the backlog limit is 5 (200 when Server), so the Professional edition is not able to accept() more than 5 new connections concurrently. More Info MS KB127144
Note even if having optimized Windows to handle many concurrent connections, then connections might still be refused when reaching a certain limit, in case a NAT-Router/Firewall is placed infront of it, which is unable to handle so many concurrent connections.
Note if having activated SYN-Attack-Protection (Enabled by default in Win2k3 SP1) or installed WinXP SP2, a limit is introduced on how many connection attempts (half-open) one can make simultaneously (XP SP2 & Vista = 10; Vista SP2 = no limit). This will keep worms like blaster and sasser from spreading too fast, but it will also limit other applications that creates many new connections simultaneously (Like P2P).
EventID 4226: TCP/IP has reached the security limit imposed on the number of concurrent TCP connect attempts
Windows Vista SP2 removes the limit again, but it can be enabled with the following DWORD registry setting:
[HKEY_LOCAL_MACHINE \SYSTEM \CurrentControlSet \Services \Tcpip \Parameters]
EnableConnectionRateLimiting = 1
Как увеличить порог TCP-соединений?
Wireshark — Анализ TCP соединений
Привет всем! Никто не подскажет где можно найти почитать про принципы анализа TCP соединений.
Как увеличить (оптимизировать) скорость TCP сервера?
Всем привет. Я написал свой асинхронный TCP сервер на шарпах, использую его для игры. Запускаю.
[Qt] Получить список tcp соединений и прослушиваемых портов
Никак не могу найти, как получить список текущих подключений. Нужна такая же информация, как при.
Вывод всех tcp, udp соединений. Аналог tcpview
Здравствуйте. Насколько сложно написать софт, аналог tcpview? Я так понимаю для таких целей лучше.
Если есть желание:
» Увеличение максимального количества одновременных TCP/IP-соединений в Windows 7/8/10
1. Запустите Редактор реестра (Win+R -> regedit -> Enter)
2. Перейдите по пути:
3. Создайте параметр DWORD (32-бита) с наименованием MaxUserPort и значением FFFE
4. Создайте параметр DWORD (32-бита) с наименованием EnableConnectionRateLimiting и значением 0
5. Перезагрузите компьютер».
«FFFE» в десятичной системе будет равно 65534.
Заказываю контрольные, курсовые, дипломные и любые другие студенческие работы здесь или здесь.
Понятия: Интервал маяка, Порог RTS, Порог фрагментации, Интервал DTIM ?
Доброго времени суток всем. Поясните, пожалуйста, как выставлять некоторые пункты в настройках.
Увеличить очередь tcp reassembly
Добрый день. На циске 1921 начали сыпаться следующие сообщения: Apr 18 06:07:51.558.
TCP/IP пакеты. Как можно изменить служебные параметры заголовка TCP или UDP?
Всем привет! Работаю с передачей данных через интернет. Как можно изменить служебные параметры.
как создать TCP клиент, TCP сервер ? На С++
Очень нужна помощь!Как написать TCP клиент, TCP сервер. Например,клиент вводит строку с клавиатуры.
What is the theoretical maximum number of open TCP connections allowed on a Windows server [closed]
Want to improve this question? Update the question so it’s on-topic for Stack Overflow.
Closed 5 years ago .
On my Windows server I have a port open listening to incoming TCP connections from multiple clients. Is there a limit to the number of unique clients that can concurrently establish a socket connection on that opened port on my Windows server? One of the threads What is the theoretical maximum number of open TCP connections that a modern Linux box can have talks about number of socket connections being limited by the allowed file descriptors on Unix platforms. Is there such a limitation on the latest available Windows servers? If so how to go about changing that limit?
2 Answers 2
It depends on the edition, Web and Foundation editions have connection limits while Standard, Enterprise, and Datacenter do not.
Though as Harry mentions in another answer, there is a setting for open TCP connections that has a limit of a bit over 16M.
But while technically you could have a large amount of connections, there are practical issues that limit the amount:
each connection is identified by server address and port as well as client address and port. Theoretically even the number of connections two machines can have between them is very large, but usually the server uses a single port which limits the number. Also rarely a single client would open thousands of connections, but in NAT cases it may seem like it
the server can only handle a certain amount of data and packets per second, so a high speed data transfer or lots of small packets may cause the number to go down
the network hardware might not be able to handle all the traffic coming in
the server has to have memory allocated for each connection, which again limits the number
also what the server does is an important issue. Is it a realtime game server or a system delivering chess moves between people thinking their moves for 15 minutes at a time
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.
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 ).
Which is the maximum number of Windows concurrent tcp/ip connections?
In .NET I have already tried the configuration below successfully:
Using 100 concurrent HttpWebRequest they answered almost simultaneously (less than a second).
I wonder why some people wrote in some forums that Windows XP and Windows Server 2008 limits this number to 15 or 20. They are right?
4 Answers 4
It could be because people are confusing the number of inbound SMB connections with the number of TCP/IP connections. SMB is used for file sharing and various other things and is limited to 10 connections in Windows Client OSes.
The client versions of Windows are restricted in the number of half-open connections.
The 10 limit for XP is well known, Vista has other limits depending on the version (e.g. Home Basic has a limit of 2 , Ultimate has 25 ).
You can Google «Patch for Event ID 4226» to alleviate these limits. Post Vista SP2 the behavior is configurable through a registry key.
Windows Server can handle several tens of thousands of concurrent inbound connections given enough resources.
Depending on your server version, you have to change some default parameters to allow these many connections to see this guide.
The author reports having seen 50.000+ concurrent connections to IIS6 on WS03SP1 x64 with 4GB RAM.