SqlConnection.open takes 26 seconds to complete on first run

M

Mark Gilbert

I've been coding asp.net sites for a while now and this is beginning
to really annoy me.

SqlConnection.open takes roughly 26 seconds to complete the first time
the site is run after a new compile, whether in debug or release.

After its happened once i can render pages in no time at all, its just
that first time.

It's a huge pain if i'm making lots of small changes and trying the
site each time. Lots and lots of tapping of fingers, i've almost worn
them out.



Example of something that takes half a minute

oConn = New SqlConnection("uid = [hidden]; pwd = [hidden];data
source=localhost;persist security info=False;initial catalog =
[hidden]")
' Start timing now
oConn.Open()
' End timing...phew 26 seconds!


Any ideas?
 
M

Marina

I've never heard of anyone having a problem like this that is specific to
opening connections. Usually the delay is in just serving up the first page
regardless of what it does - but that is because the app is restarting, not
due to the first sql connection opening.

Try to see if this is reproduceable on only one machine, or on several
machines? If it just 1, I would suggest looking into what is different about
the server exhibiting this behavior.
 
M

Mark Gilbert

I work from home and only have one machine.
It's not the app starting up. If i insert a breakpoint on the
SqlConnection.open line, wait for everything to settle down (HD
activity and all that) then execute the line it will still take ages.
Also, to add to the oddness, i tried it with taskmanager open, during
the wait cpu usage is only around 3 or 4 percent and theres no
abnormal HD activity either.

It's almost as if asp.net is purposly waiting for something.
Also, if i do the same thing in a normal vb.net app (not asp) there
are no speed problems.

Could it be the way the asp.net user account is set up? Or how
security is set up in IIS? Ugh, i really have nothing to go on.

Marina said:
I've never heard of anyone having a problem like this that is specific to
opening connections. Usually the delay is in just serving up the first page
regardless of what it does - but that is because the app is restarting, not
due to the first sql connection opening.

Try to see if this is reproduceable on only one machine, or on several
machines? If it just 1, I would suggest looking into what is different about
the server exhibiting this behavior.

Mark Gilbert said:
I've been coding asp.net sites for a while now and this is beginning
to really annoy me.

SqlConnection.open takes roughly 26 seconds to complete the first time
the site is run after a new compile, whether in debug or release.

After its happened once i can render pages in no time at all, its just
that first time.

It's a huge pain if i'm making lots of small changes and trying the
site each time. Lots and lots of tapping of fingers, i've almost worn
them out.



Example of something that takes half a minute

oConn = New SqlConnection("uid = [hidden]; pwd = [hidden];data
source=localhost;persist security info=False;initial catalog =
[hidden]")
' Start timing now
oConn.Open()
' End timing...phew 26 seconds!


Any ideas?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top