Keep your ASP.Net websites warm and fast 24/7

comments

ASP.Net web applications are awesome most of the time. But there is a sad reality: ASP.Net applications are tuned to handle huge amounts of traffic, not 50 page views a day. This becomes an issue when you have limited traffic to your site, because if your it doesn’t keep being viewed, your application pool may recycle, and that important visitor number 1 gets screwed waiting as your site rebuilds or your app pool to fires up. Whether it’s a SharePoint site, an ASP.Net or your internal TFS 2008/TFS 2010 Server, you want it to be FAST… all the time.

Now before i continue let me say one little caveat: all the haters out there who show this as proof of ASP.Net sucking, you need to concentrate on your own shiat, cause I'm not listening, and this is not the right forum – so on with the solution.

imageYou like it so’hot – City Wok Style

You can solve this problem any number of ways. You could build a little app to ping your site, or you could use one that’s “been prepared earlier”. The solution is that you need to simulate a visitor to your site every now and then.

Application Warm-up to the rescue

You have IIS 7/Windows 2008. You have lots of magical add-ons at your disposal. Then you have an answer in the form of Application Warm-up. WIN!

As the IIS download page says:

“…IIS Application Warm-Up for IIS 7.5 enables IT Professionals to improve the responsiveness of their Web sites by loading the Web applications before the first request arrives…”

What this means for you:

Preheat your ASP.Net Sites

So lets setup your Application warm up settings for your site. Firstly figure out what pages are most important, mission critical pages, that need to be speedy all the time. Grab the URLS, and that’s all your need.

I usually use the following but it really varies site to site and you’ll have different ones:

  • /default.aspx
  • /login.aspx (so returning users can get in ASAP)

Open IIS Manager and select your site. Then select the new Application Warm-up icon thats been added by you installing the IIS addon.;

image

Configure what users you want to fake to access the site from by clicking the edit user context link on the right (this can be important if your site uses some form of authentication)

image

Click the setting link on the right and turn on the application warm up and also select to “Start the application pool when the service starts” this will make sure that your app pool is armed and ready to go when you need it.

 image

Then create a new entry for each of your URLs by clicking on the Add request link

image

Review your URL's and your done :)

image

Warm your SharePoint Sites

Setting up SharePoint sites with Application warm up is just as easy, as most of the application is cached, and most of the entry pages follow the same format. Much of this is the same except for the URLs you enter, to make it clear i’ll repeat from the top, but in regards to SharePoint. If you have any specific sharepoint portal pages you want to be kept hot hot hot then enter these here to.

Open IIS Manager and select your site. Then select the new Application Warm-up icon.

image

Configure what users you want to simulate access to the site from by clicking the edit user context link on the right this is important if you are running a secured sharepoint site that requires users to be logged in before they continue.

image

Click the setting link and turn on the application warm up and also select to “Start the application pool when the service starts” this will make sure that your app pool is armed and ready to go when you need it.

 image

Create a new entry for each of your SharePoint portal page URLs, I've selected the home page of each of my SharePoint Sites as most of the time simply keeping the SharePoint app moving helps ALOT because so much of it is cached. If you have any specific pages or links to web parts or reports enter these as well.

 image

Review your SharePoint portal URL’s and your done – it’s that simple :)

image

 

Warm your TFS 2008/TFS 2010 Sites

Like the SharePoint sites above TFS can be quite simple to take care of as most of its pages follow the same format. You want to take care of the landing TFS web calls, your collection home, and any really important project homes.

URL's to use:

  • /tfs/
  • /tfs/web/
  • /tfs/DefaultCollection/[your project name]
  • /sites/DefaultCollection (for your sharepoint project portals)

Open IIS Manager and select your site. Then select the new Application Warm-up icon.

image

Create a new entry for each of your URLs

image

Review your URL’s and your done

 image

Happy application hosting !