We have a very strange problem with an intermittent situation that began to appear in the last month or so, when some connections to the mssql server fail with an error:
System.Data.SqlClient.SqlException: A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections. (provider: Named Pipes Provider, error: 40 - Could not open a connection to SQL Server)
The error does not crash the site and does not require restarting db - if you just restart the same request, it will work a second time. This means that many users will occasionally encounter an error and need to refresh the error page to work.
Now my initial reaction to the knee jerk was due to:
The problem with resources is why I started running the SQL profiler and perfmon, but I did not find any problems with the service trying to keep up with the number of connections / sec. I watched MSSQL: SQL errors, MSSQL: wait statistics, MSSQL: Exec statistics, MSSQL: locks. Does anyone have any recommendations on other statistics that I have to push and push here?
Unblocked database connections - I selected this code after passing through the entire data layer code. We have all the fail-safe safes to stop this.
Connection / network problem: our SQL server is located on a separate server (MS SQL Server Standard 2008) on our application server (ASP.Net runs on IIS7) - both servers work on xlarge Amazon EC2 instances with all security policies configured (in accordance with the direction of the Amazons). Has anyone received guidance on testing the connection between two servers, or if this could be a problem?
Is this a possible problem with the IIS connection string? I have not tested this, but should we fully qualify the server with the name of the computer with which we are connecting (just thinking about it)? We use the connection string in the format: server=xxxxx;Database=xxxx;uid=xxxx;password=xxx;
Your thoughts and understanding are greatly appreciated!
Thank you in advance
source share