Saturday, February 25, 2012

Remote Connections Refused when server under load

Hi All,
We have a .NET 2.0 web application. Occasionally, we get the following
error below when we are doing performance testing. It is not consistent and
only happens every once in awhile. We are using TCP/IP and only have one
instance of SQL running. We do specify connection pooling in the connection
string. There is virtually nothing happening on the database server - it
only contains a few rows of data to control navigation for the site.
System.Data.SqlClient.SqlException: An error has occurred while establishing
a connection to the server. When connecting to SQL Server 2005, this failur
e
may be caused by the fact that under the default settings SQL Server does no
t
allow remote connections. (provider: Named Pipes Provider, error: 40 - Could
not open a connection to SQL ServerThis is a different error and not quite what you describe but it might be
involved in your problem. This is from the Books Online topic "Server
Network Configuration."
Connections May Be Forcibly Closed When Running on Windows Server 2003 SP1
When testing scalability with a large number of client connection attempts
to an instance of the SQL Server Database Engine running on Windows Server
2003 Service Pack 1, Windows may drop connections if the requests arrive
faster than SQL Server can service them. This is a security feature of
Windows Server 2003 Service Pack 1, which implements a finite queue for
incoming TCP connection requests. It results in the following error:
ProviderNum: 7, Error: 10054, ErrorMessage: "TCP Provider: An existing
connection was forcibly closed by the remote host ...
To resolve this issue, use the regedit.exe utility to add the following
registry key:
Key Type Name Value
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControl
Set\Services\Tcpip\Parameters\
DWORD
SynAttackProtect
00000000
Security Note:
Setting this registry key may expose the server to a SYN flood,
denial-of-service attack. Add this registry value only if necessary and with
an understanding of the security risks. Remove this registry value when
testing is complete.
Rick Byham (MSFT)
This posting is provided "AS IS" with no warranties, and confers no rights.
"Bill P" <Bill P@.discussions.microsoft.com> wrote in message
news:2D3D349D-EE1C-4945-82FE-D3717AD02E2F@.microsoft.com...
> Hi All,
> We have a .NET 2.0 web application. Occasionally, we get the following
> error below when we are doing performance testing. It is not consistent
> and
> only happens every once in awhile. We are using TCP/IP and only have one
> instance of SQL running. We do specify connection pooling in the
> connection
> string. There is virtually nothing happening on the database server - it
> only contains a few rows of data to control navigation for the site.
> System.Data.SqlClient.SqlException: An error has occurred while
> establishing
> a connection to the server. When connecting to SQL Server 2005, this
> failure
> may be caused by the fact that under the default settings SQL Server does
> not
> allow remote connections. (provider: Named Pipes Provider, error: 40 -
> Could
> not open a connection to SQL Server|||Rick,
Thank you for the reply. It very well could have something to do with this.
I am going to give it a try. It may be a few days before I find anything
out since this happens only once in a while.
Bill Portman
"Rick Byham, (MSFT)" wrote:

> This is a different error and not quite what you describe but it might be
> involved in your problem. This is from the Books Online topic "Server
> Network Configuration."
> Connections May Be Forcibly Closed When Running on Windows Server 2003 SP1
> When testing scalability with a large number of client connection attempts
> to an instance of the SQL Server Database Engine running on Windows Server
> 2003 Service Pack 1, Windows may drop connections if the requests arrive
> faster than SQL Server can service them. This is a security feature of
> Windows Server 2003 Service Pack 1, which implements a finite queue for
> incoming TCP connection requests. It results in the following error:
> ProviderNum: 7, Error: 10054, ErrorMessage: "TCP Provider: An existing
> connection was forcibly closed by the remote host ...
> To resolve this issue, use the regedit.exe utility to add the following
> registry key:
> Key Type Name Value
> HKEY_LOCAL_MACHINE\SYSTEM\CurrentControl
Set\Services\Tcpip\Parameters\
> DWORD
> SynAttackProtect
> 00000000
> Security Note:
> Setting this registry key may expose the server to a SYN flood,
> denial-of-service attack. Add this registry value only if necessary and wi
th
> an understanding of the security risks. Remove this registry value when
> testing is complete.
> --
> Rick Byham (MSFT)
> This posting is provided "AS IS" with no warranties, and confers no rights
.
> "Bill P" <Bill P@.discussions.microsoft.com> wrote in message
> news:2D3D349D-EE1C-4945-82FE-D3717AD02E2F@.microsoft.com...
>

No comments:

Post a Comment