Slow first page load on asp.net site

Every now and then (always after a long period of idle-time, e.g. overnight) when I access a site built using asp.net - it takes around 15 seconds to load the page (15 seconds before I see any progress whatsoever, then the page comes up fast).

Further pages on that site, or refreshes, are quick as usual - they are also fast on other machines, only the first one seems to take the 'hit'.

Page tracing never through anything up (whole cycle was a fraction of a second)

So my question is where else should I be looking? Perhaps IIS? Or could it still be my asp.net app and I'm just looking in the wrong place (the trace) for clues?

As I don't have much control over the IIS server, anything I can check through asp.net would be more helpful, before I go ask that particular admin.

cheers :D


Solution 1:

The IIS application pool is shut down after 30 minutes of inactivity. After that, when you make a request IIS basically has to start the website up again, which leads to the behavior you are describing. You can change the idle time of your website in iis though to avoid it.

Solution 2:

You could also look into the Auto-Start feature of the 4.0 framework.

Solution 3:

If you're using IIS 7 there is an IIS plugin call Application Warm Up that will help

I've written a blog post about my experiences using it here (don't know if i'm allowed to post to my own content?):

http://www.diaryofaninja.com/blog/2010/05/06/keep-your-aspnet-websites-warm-and-fast-247

Solution 4:

You can schedule the recycling of the application pool, possibly using a warm-up script. Give it its own application pool first and see if that helps.