In our testing environment, opening a SqlConnection takes around 5 seconds. I would like to investigate why it is taking so long, but I am not sure where to look at. Until the connection is open there are no entries in the SqlProfiler. The sql server (ver 2012) is running on a separate machine and we are connecting to it from another computer in the same network. We see the 5 second freeze in console applications as well as from the IIS (ASP.NET). The communication itself is fast.
Here's a screenshot from dotTrace:
What can I do to investigate what exactly is taking those 5 seconds? Thanks.
Update: Thanks everyone for great comments. It was the authentication - once we switched from integrated to sql authentication, the slowdowns were gone.