If you want to keep your websites or webservices warm and save user from seeing the long warm up time after an application pool recycle, or IIS restart or new code deployment or even windows restart, you can use the tinyget command line tool, that comes with IIS Resource Kit, to hit the site and services and keep them warm. Here’s how:
First get tinyget from here. Download and install the IIS 6.0 Resource Kit on some PC. Then copy the tinyget.exe from “C:\Program Files (x86)\IIS Resources\TinyGet\” to the server where your IIS 6.0 or IIS 7 is running.
Then create a batch file that will hit the pages and webservices. Something like this:
SET TINYGET=C:\Program Files (x86)\IIS Resources\TinyGet\tinyget.exe
"%TINYGET%" -srv:dropthings.omaralzabir.com -uri:http:"%TINYGET%" -srv:dropthings.omaralzabir.com -uri:http:
Save this in a batch file and run it as a scheduled task at some interval like 10 minutes and your website will always remain nice and warm.
First I am hitting the homepage to keep the webpage warm. Then I am hitting the webservice URL with ?WSDL parameter, which allows ASP.NET to compile the service if not already compiled and walk through all the operations and reflect on them and thus loading all related DLLs into memory and reducing the warmup time when hit.
Tinyget gets the servers name or IP in the –srv parameter and then the actual URI in the –uri. I have specified what’s the HTTP response code to expect in –status parameter. It ensures the site is alive and is returning http 200 code.
Besides just warming up a site, you can do some load test on the site. Tinyget can run in multiple threads and run loops to hit some URL. You can literally blow up a site with commands like this:
"%TINYGET%" -threads:30 -loop:100 -srv:google.com -uri:http:
Tinyget is also pretty useful to run automated tests. You can record http posts in a text file and then use it to make http posts to some page. Then you can put matching clause to check for certain string in the output to ensure the correct response is given. Thus with some simple command line commands, you can warm up, do some transactions, validate the site is giving off correct response as well as run a load test to ensure the server performing well. Very cheap way to get a lot done.