From time to time our server throw this well-known exception:
Timeout expired. The timeout period elapsed prior to completion of the operation or the server is not responding.
This happens under pressure when the server is working on big requests. I did some research and found out that I could change connection string connection timeout setting and/or SqlCommand.Timeout data reader properties.
By default, sql command timeout is set to 30 seconds and connection timeout to 15, and we never override them.
I reproduced the context and executed the failling requests by hand in management studio. Their duration are around 1 second and always far beyond 30.
But strangely when I take a look at the server logs, this exception is thrown right away the request call. I mean, the request is executing and one millisecond later the exception is raised. Excuse me but let me do my geek look about this 8-o.
To be complete, our sql instance is mirrored with another one in synchronous mode. We use Ado.Net through table adapters.