When doing performance testing, if the tested system page is simple and has good performance, it will cause the press to get insufficient tcp links and cause the following errors: HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\tcpip\Parameters\TcpTimedWaitDelay to 30 and HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\tcpip\Parameters\MaxUserPort to 65534 and rebooting the machine See the readme.doc file for more information The most introduced through Baidu search is to modify the two values of TimedWaitDelay and MaxUserPort, which are relatively small points that modify TimedWaitDelay, which can be determined according to the actual situation. At the same time, the value of MaxUserPort is modified to be larger, but after modifying and restarting the machine, the problem still exists. [HKEY_LOCAL_MACHINE \System \CurrentControlSet \Services \Tcpip \Parameters] TcpNumConnectionsSearch = 0x00fffffe (Default = 16,777,214) The above registry information configures the maximum number of TCP connections allowed on a single machine, which is 16M by default. This number seems large, and this is not the only condition that limits the maximum number of connections, there are other conditions that limit the maximum number of connections to a TCP connection. Maximum number of dynamic ports When a TCP client and server connect, the client must be assigned a dynamic port, which is assigned in the default range of 1024-5000, which means that by default, the client can initiate up to 3977 socket connections at the same time. We can modify the following registry to adjust the scope of this dynamic port [HKEY_LOCAL_MACHINE \System \CurrentControlSet \Services \Tcpip \Parameters] MaxUserPort = 5000 (Default = 5000, Max = 65534) Maximum number of TCBs The system assigns a TCP control block (TCP control block or TCB) to each TCP connection, which is used to cache some parameters of the TCP connection, and each TCB needs to allocate 0.5 KB of pagepool and 0.5 KB of non-pagepool, which means that each TCP connection will occupy 1KB of system memory. The maximum number of TCBs in a system is determined by the registry settings below [HKEY_LOCAL_MACHINE \System \CurrentControlSet \Services \Tcpip \Parameters] MaxFreeTcbs = 2000 (Default = RAM dependent, but usual Pro = 1000, Srv=2000) For non-Server versions, the default value of MaxFreeTcbs is 1000 (more than 64M physical memory) Server version, this defaults to 2000. This means that by default, Server versions can establish and maintain up to 2000 TCP connections at the same time. Maximum number of TCB hash tables TCB is managed through a hash table, and the following registry settings determine the size of this hash table HKEY_LOCAL_MACHINE \System \CurrentControlSet \services \Tcpip \Parameters] MaxHashTableSize = 512 (Default = 512, Range = 64-65536) This value indicates the amount of memory allocated to the pagepool, that is, if MaxFreeTcbs = 1000, the amount of memory in the pagepool is 500KB Then MaxHashTableSize should be greater than 500. The larger the number, the more redundant the hash table will be, and the less time it will take to allocate and find TCP connections each time. This value must be a power of 2 and the maximum is 65536. MaxUserPort = 65534 (Decimal) MaxHashTableSize = 65536 (Decimal) MaxFreeTcbs = 16000 (Decimal) Here we can see that MaxHashTableSize is configured to be 4 times larger than MaxFreeTcbs, which greatly increases the speed of TCP establishment. Attached is the registration form file:
连接数.reg
(280 Bytes, Number of downloads: 2)
|