INF: SQL Logs 17832 with Multiple TCP\IP Connection Requests (154628)



The information in this article applies to:

  • Microsoft SQL Server 7.0
  • Microsoft SQL Server 6.5
  • Microsoft SQL Server 6.0
  • Microsoft SQL Server 2000 (all editions)

This article was previously published under Q154628
IMPORTANT: This article contains information about modifying the registry. Before you modify the registry, make sure to back it up and make sure that you understand how to restore the registry if a problem occurs. For information about how to back up, restore, and edit the registry, click the following article number to view the article in the Microsoft Knowledge Base:

256986 Description of the Microsoft Windows Registry

SUMMARY

If SQL Server is hit with multiple and simultaneous TCP/IP connection requests, such as the case with World Wide Web servers, the requests are quickly rejected by responding with a TCP/IP Reset Frame.

This symptom is difficult to detect. If the client application includes error code handling, the native error code is 10061 (WSAECONNREFUSED) for the Open() function. On the server, Error 17832 - "Unable to read login packet" appears in the SQL Error log.

If you trace this problem with a protocol analyzer, you can see that some of the connection request frames have been replied to with the TCP Reset bit set, which tells the sending station that the frame has been received, but the server does not have the resources to process the connection request.

MORE INFORMATION

A Winsock application accepts connections on a port by calling a Listen() function, which has a backlog parameter specifying the maximum length of the pending-connection queue. The Winsock specification defines the maximum Listen() backlog at five and when it exceeds five, TCP/IP issues a Reset.

The backlog for SQL Server can be configured to handle a great number of pending connections by modifying the Windows NT Registry. In some cases, the connection reset issue is resolved due to the modification.

WARNING: If you use Registry Editor incorrectly, you may cause serious problems that may require you to reinstall your operating system. Microsoft cannot guarantee that you can solve problems that result from using Registry Editor incorrectly. Use Registry Editor at your own risk.

  1. Start Registry Editor (REGEDT32.EXE) and locate the following Registry subkey in the HKEY_LOCAL_MACHINE subtree:

    \Software\Microsoft\MSSQLServer\MSSQLServer

    NOTES:
    • The corresponding registry subkey in the HKEY_LOCAL_MACHINE subtree for SQL 4.21a is:

      \Software\Microsoft\SQLServer\Server

    • If SQL Server 6.5 Enterprise Edition is running with a Virtual SQL Server in a clustered environment, you must make the change to virtual server key, rather than the standard:

      \Software\Microsoft\MSSQLServer\MSSQLServer

      This virtual server key is:

      \Software\Microsoft\MSSQLServer$VirtualServerName
      \MSSQLServer$VirtualServerName

      Value Name: WinsockListenBacklog
      Data Type: REG_DWORD
      Data: 190

    • The new registry location for SQL Server 2000:

      For a default instance:

      HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\MSSQLServer\MSSQLServer\SuperSocketNetLib

      For a named instance:

      HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Microsoft SQL Server\Instance Name\MSSQLServer\SuperSocketNetLib

  2. Select the MSSQLServer subkey for SQL Server 6.5 and SQL Server 7.0, and select the SuperSocketNetLib for SQL Server 2000. On the Edit menu, click Add Value.
  3. Enter the following:

    Value Name: WinsockListenBacklog
    Data Type: REG_DWORD
    Data: Range is 1 to 0xFFFFFFFF

    NOTE: The data value affects overall system resources if it is set to a high value. Windows NT 3.51 has a maximum overall backlog of 100 and Windows NT 4.0 has a maximum overall backlog of 200 for all applications. The suggested method of testing with this value is to set the value in increments of five and observe the results until the connection reset stops.
  4. Click OK and quit Registry Editor.
  5. Restart SQL Server.
For more information about the Listen() function, see the WIN32 SDK Programmer's reference.

For additional information about the backlog parameter and Windows NT, click the article number below to view the article in the Microsoft Knowledge Base:

113576 WinSocket App's Reject Connection Requests with Reset Frames

127144 Windows NT 3.5 Winsock Listen (Backlog) Parameter Limit


Modification Type:MinorLast Reviewed:2/11/2004
Keywords:kbnetwork KB154628