I have an application that runs every minute using the Windows Task Scheduler. One of the first things the job does is connect to a SQL Server 2008 instance to record that the application started.
A few times a day the job is failing when making its first query with the following error message:
Connection Timeout Expired. The timeout period elapsed during the post-login phase. The connection could have timed out while waiting for server to complete the login process and respond; Or it could have timed out while attempting to create multiple active connections. The duration spent while attempting to connect to this server was - [Pre-Login] initialization=9; handshake=10342; [Login] initialization=0; authentication=1; [Post-Login] complete=4032;
We have hardware monitoring on the database server so I checked for CPU, RAM or Disk IO spikes at the times of the failures, but there weren't any spikes. The connection string is setup to use integrated security (using one of our domain service accounts). The pre-login handshake is always taking the longest.
This database server is used by a lot of applications and no other application is failing with this message. We have web apps that use the database server without problems as well as other applications that run through the task scheduler (although they don't run as frequent as every minute).
Can I increase the SQL Server logging level to expose more information about what's happening during login? Any ideas how I can address this issue?
Edit: I'm also seeing the following error message (although less frequent):
A connection was successfully established with the server, but then an error occurred during the pre-login handshake. (provider: SSL Provider, error: 0 - The wait operation timed out.)