Discussion Forums



Thread: First ASP.NET call VERY slow on each connection - why?

This question is not answered. Helpful answers available: 2. Correct answers available: 1.

Welcome, Guest Help
Login Login


Permlink Replies: 3 - Pages: 1 - Last Post: Mar 13, 2009 7:13 AM by: tomasjs
keywitness

Posts: 3
Registered: 3/4/09
First ASP.NET call VERY slow on each connection - why?
Posted: Mar 12, 2009 6:42 PM PDT
 
  Click to reply to this thread Reply

I am making calls to an ASP.net service from my desktop app. The first call tales very long - 20 sec instead of 3 sec. All subsequent calls take 3 sec, until I restart my desktop app - then again, the first call is 20 sec or so. What could be the cause?
Thank you.

ericlee996

Posts: 335
Registered: 12/7/08
Re: First ASP.NET call VERY slow on each connection - why?
Posted: Mar 12, 2009 7:53 PM PDT   in response to: keywitness
 
  Click to reply to this thread Reply

ASP.NET does a lot of caching and dynamic compilation, so the first call taking 20 seconds is not surprising.

It's odd that re-starting your desktop would affect how the service is running.

Can you describe your service more? I presume it runs in EC2? Does it talk to a database?

Thanks,

Eric.
www.learnaws.com


keywitness

Posts: 3
Registered: 3/4/09
Re: First ASP.NET call VERY slow on each connection - why?
Posted: Mar 13, 2009 7:03 AM PDT   in response to: ericlee996
 
  Click to reply to this thread Reply

Yes, it runs in EC2, and it does not use the database. I have actually looked closer into the IIS logs and saw that time-taken is correct - about 3 sec. However, when I call the application (a Web service) from a .NET app on my desktop, the first call takes 20 sec - which means the time is spent somewhere on the connection?
Thanks!


tomasjs

Posts: 27
Registered: 10/24/08
Re: First ASP.NET call VERY slow on each connection - why?
Posted: Mar 13, 2009 7:13 AM PDT   in response to: keywitness
 
  Click to reply to this thread Reply

The first time an application is run, it must dynamically compile it. This is why it's slow on the initial load after you modify it or restart the application.

Google "precompile asp.net" and you'll find some tips for precompiling your app for faster init response.


Point your RSS reader here for a feed of the latest messages in all forums