TCP/IP Port Confirguration Windows NT

来源:互联网 发布:淘宝买片搜什么关键词 编辑:程序博客网 时间:2024/04/30 11:34

Hi kumargaurav,

Here’s where you need to navigate in order to change the range of TCP IP to maximum.

Important: This section, method, or task contains steps that tell you how to modify the registry. However, serious problems might occur if you modify the registry incorrectly. Therefore, make sure that you follow these steps carefully. For added protection, back up the registry before you modify it. Then, you can restore the registry if a problem occurs. For more information about how to back up and restore the registry, click the windows help article below.

Back up the registry
http://windows.microsoft.com/en-us/windows7/Back-up-the-registry

1. Go to start and type regedit.exe.
2. Click on regedit.
3. Navigate to  HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters

4. Right-Click on Parameters and select New> DWORD with the following details.

Name: MaxUserPort 
Type: REG_DWORD
Value: 65534

5. Close the registry.

That should be it.





TcpTimedWaitDelay:确定 TCP/IP 可释放已关闭连接并重用其资源前,必须经过的时间。关闭和释放之间的此时间间隔通称 TIME_WAIT 状态或两倍最大段生命周期(2MSL)状态。此时间期间,重新打开到客户机和服务器的连接的成本少于建立新连接。减少此条目的值允许 TCP/IP 更快地释放已关闭的连接,为新连接提供更多资源。如果运行的应用程序需要快速释放和创建新连接,而且由于 TIME_WAIT 中存在很多连接,导致低吞吐量,则调整此参数。 如何查看或设置: 使用 regedit 命令访问 HKEY_LOCAL_MACHINE/SYSTEM/CurrentControlSet/ Services/TCPIP/Parameters 注册表子键并创建名为 TcpTimedWaitDelay 的新 REG_DWORD 值。 将此值设置为十进制 30,其为十六进制 0x0000001e。该值将等待时间设置为 30 秒。 停止并重新启动系统。 缺省值:0xF0,它将等待时间设置为 240 秒(4 分钟)。 建议值:最小值为 0x1E,它将等待时间设置为 30 秒。您可以通过使用客户端计算机上的 Netstat 工具来检查有多少客户端端口处于 TIME_WAIT 状态。按如下所示使用 -n 标志运行 Netstat 工具,并数一数到您的客户端套接字中有多少处于 TIME_WAIT 状态。在此示例中,运行 SQL Server 的远程计算机的 IP 地址是 10.10.10.20,客户端计算机的 IP 地址是 10.10.10.10,有三个已建立的连接,有两个处于 TIME_WAIT 状态的连接:

C:>netstat -n Active Connections Proto Local Address

Foreign Address State TCP 10.10.10.10:2000

10.10.10.20:1433 ESTABLISHED TCP 10.10.10.10:2001

10.10.10.20:1433 ESTABLISHED TCP 10.10.10.10:2002

10.10.10.20:1433 ESTABLISHED TCP 10.10.10.10:2003

10.10.10.20:1433 TIME_WAIT TCP 10.10.10.10:2004

10.10.10.20:1433 TIME_WAIT

如果您运行 netstat -n 并发现有将近 4000 个到运行 SQL Server 的目标计算机的 IP 地址的连接处于 TIME_WAIT 状态,则可以增加默认 MaxUserPort 设置并同时降低 TcpTimedWaitDelay 设置,以便不会用尽客户端匿名端口。例如,您可以将 MaxUserPort 设置为 20000,将 TcpTimedWaitDelay 设置为 30。较低的 TcpTimedWaitDelay 设置意味着套接字在 TIME_WAIT 状态中等待的时间更短。较高的 MaxUserPort 设置意味着您可以让更多的套接字处于 TIME_WAIT 状态。

注意,如果调整 MaxUserPort 或 TcpTimedWaitDelay 设置,您必须重新启动 Microsoft Windows 以使新设置生效。MaxUserPort 和 TcpTimedWaitDelay 设置适用于任何通过 TCP/IP 套接字与运行 SQL Server 的计算机对话的客户端计算机。如果在运行 SQL Server 的计算机上进行这些设置,它们将不起作用,除非您是在建立本地 TCP/IP 套接字到运行 SQL Server 的本地计算机的连接。

Windows Registry Editor Version 5.00
  [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters]

限制处于TIME_WAIT状态的最长时间。缺省为240秒,最低为30秒,最高为300秒。建议设为30秒。
  "TcpTimedWaitDelay"=dword:0000001e

 

MaxUserPort :确定在应用程序从系统请求可用用户端口时,TCP/IP 可指定的最高端口号。 如何查看或设置: 使用 regedit 命令访问 HKEY_LOCAL_MACHINE/SYSTEM/CurrentControlSet/ Services/TCPIP/Parameters 注册表子键并创建名为 MaxUserPort 的新 REG_DWORD 值。 停止并重新启动系统。 缺省值:无 建议值:至少十进制 32768。 注:当在 Windows NT 或 Windows 2000 操作系统上调整 WebSphere Application Server 时,同时使用这两个参数。希望本站的知识能给您的工作、学习和生活带来方便和乐趣!


0 0