Two days ago, without any code changes or changes to the database, I do not get many (every 5 minutes or so) errors with the The wait operation timed out error with two different underscores of the complete errors about pre-registration and another message:
System.Data.Entity.Core.EntityException: The underlying provider could not open Open. ---> System.Data.SqlClient.SqlException: connection timed out. The waiting period has expired while trying to use an authorization confirmation confirmation before entering the system. This may be due to the fact that the handshake before entering the system failed or the server was unable to respond on time. The duration spent trying to connect to this server was - [Pre-Login] initialization = 21; acknowledgment = 14988; ---> System.ComponentModel.Win32Exception: timeout
System.Data.Entity.Core.EntityException: The underlying provider could not open Open. ---> System.Data.SqlClient.SqlException: connection timed out. The waiting period expires during the phase after entry. The connection may be disconnected while waiting for the completion of the login process and a response; Or it may result in a timeout when trying to create multiple active connections. This error occurred while trying to connect to the routing destination. The duration spent trying to connect to the source server was - [Pre-Login] initialization = 5; acknowledgment = 3098; [Login] initialization = 0; Authentication = 0; [Post-Login] complete = 7; The duration spent trying to connect to this server was - [Pre-Login] initialization = 20; acknowledgment = 5; [Login] initialization = 0; Authentication = 0; [Post-Login] complete = 11003; ---> System.ComponentModel.Win32Exception: timeout
I am using Entity Framework and my website is hosted on Azure Web App. I did some digging, and most of the SO questions that I find in this are NOT Entity Framework-specific, but the ADO.Net few messages I found led me to upgrade from the Basic to Standard (S0) service for the database and create GlobalDBConfig via
public class GlobalDBConfig : DbConfiguration { public GlobalDBConfig() { SetExecutionStrategy("System.Data.SqlClient", () => new SqlAzureExecutionStrategy(2, TimeSpan.FromSeconds(30))); } }
How can I find out what is still wrong and fix it? This is a very simple database with simple queries and very little traffic to the site (less than 1000 visits per day)
source share