Long time to load first sql connection in .NET.
For some reason, it takes 7 seconds to open a connection to a SQL Server database, subsequent connections come in second. any idea what could be the reason?
I am using C # and asp.net
Its after compilation, I am the entity every time I restart the site, which means that every time it needs to actually create the "first" connection. I understand that setting up a connection pool has an overhead, but I've never seen that I have to take 7 seconds to set it up.
+2
source to share
3 answers
The first time you need to establish a connection, which has a lot of overhead. Each subsequent connection uses a connection pool (assuming you have the same connection string) and no initial setup is required.
Edit: See this link or this one for information on connection pooling.
+1
source to share