First Connection Open Slow from ASP.Net

  • Thread starter Thread starter Brian Mahloch
  • Start date Start date
B

Brian Mahloch

Strange situation here. Independent of data provider the
very first connection my webservice or webpage (asp.net)
makes to my sql server takes an unacceptable amount of
time (30 seconds or longer). After the first one is
established subsequent connections open instantly, until
the service or site needs reloading. I cannot seem to
track down any specific reason for this behavior.
Connection string options, autentication mode, IP vs.
Name, etc seem to have no or very little impact on this
first connection opening. Any insight or suggestions
would be greatly appreciated.
 
Hi Brian,

The speed of next connections is a feature of connection pooling I think.
Why the first connection is slow, who knows.
Did you try creating a simple (console) app that uses the same connection
string and run it on that machine?
 
I created a simple windows form app that just opens the
connection and then closes it, same as what I stripped the
code down to in both by service and web page. From the
windows app the first connection open is still longer that
subsequent openings, but greatly reduced in time compared
to the service or web page (2 - 5 seconds). To rule out
machine hardware limitations I set up the database and
service from server grade machines and noticed the same
results. What's unfortunate is it's critical that I
receive this information via a web service, however data
will only be coming in at scheduled intervals which I
can't guarantee to be similiar in time. This probably
means the service will need to "reiniliation" often
causing this delayed first connection opening.

At this point there is so much invested I am willing to
fight this "tooth and nail" to remedy. Any additional
suggestions are welcome as I hope to provide updates as I
come closer to resolve.
-----Original Message-----
Hi Brian,

The speed of next connections is a feature of connection pooling I think.
Why the first connection is slow, who knows.
Did you try creating a simple (console) app that uses the same connection
string and run it on that machine?

--
Miha Markic [MVP C#] - RightHand .NET consulting & development
SLODUG - Slovene Developer Users Group
www.rthand.com

Brian Mahloch said:
Strange situation here. Independent of data provider the
very first connection my webservice or webpage (asp.net)
makes to my sql server takes an unacceptable amount of
time (30 seconds or longer). After the first one is
established subsequent connections open instantly, until
the service or site needs reloading. I cannot seem to
track down any specific reason for this behavior.
Connection string options, autentication mode, IP vs.
Name, etc seem to have no or very little impact on this
first connection opening. Any insight or suggestions
would be greatly appreciated.


.
 
Are you sure you have isolated this to the Sql Server connection itself?
First requests to aspx and asmx pages are always slower than subsequent
requests, regardless of whether there is a database connection being made.
Not knowing the structure of your pages and code modules makes it hard to
know for certain.

Scott L.

Brian Mahloch said:
I created a simple windows form app that just opens the
connection and then closes it, same as what I stripped the
code down to in both by service and web page. From the
windows app the first connection open is still longer that
subsequent openings, but greatly reduced in time compared
to the service or web page (2 - 5 seconds). To rule out
machine hardware limitations I set up the database and
service from server grade machines and noticed the same
results. What's unfortunate is it's critical that I
receive this information via a web service, however data
will only be coming in at scheduled intervals which I
can't guarantee to be similiar in time. This probably
means the service will need to "reiniliation" often
causing this delayed first connection opening.

At this point there is so much invested I am willing to
fight this "tooth and nail" to remedy. Any additional
suggestions are welcome as I hope to provide updates as I
come closer to resolve.
-----Original Message-----
Hi Brian,

The speed of next connections is a feature of connection pooling I think.
Why the first connection is slow, who knows.
Did you try creating a simple (console) app that uses the same connection
string and run it on that machine?

--
Miha Markic [MVP C#] - RightHand .NET consulting & development
SLODUG - Slovene Developer Users Group
www.rthand.com

Brian Mahloch said:
Strange situation here. Independent of data provider the
very first connection my webservice or webpage (asp.net)
makes to my sql server takes an unacceptable amount of
time (30 seconds or longer). After the first one is
established subsequent connections open instantly, until
the service or site needs reloading. I cannot seem to
track down any specific reason for this behavior.
Connection string options, autentication mode, IP vs.
Name, etc seem to have no or very little impact on this
first connection opening. Any insight or suggestions
would be greatly appreciated.


.
 
Back
Top