tags:

views:

151

answers:

2

IIS 7.5 introduces the notion of auto-start providers, that allow you to get WAS to auto-load an application or assemblies when an application pool starts up.

Can a similar thing be acheived with IIS7?

Basically, we have an application that runs under WAS, and has an in-memory cache of data. When an application pool recycle occurs, my WAS deployed app won't actually be activated until the first hit for it is received. This means that the cache is cold when the first hit is received. It would be good to be able to pre-start the applicaiton as soon as the app pool is recycled.

Other options we've considered are

  • Deploying the application as a Windows service so it doesn't re-cycle (this would work, but the application lifecycle management of IIS/WAS is a useful thing apart from this issue)
  • Writing a seperate service whose job it is to ping our application to warm it up.

However, the nicest way would be to get IIS7/WAS to do this for us.

+3  A: 

In Windows 2008 you can log events that occur on the application pool, so you can log recycle events. You can configure the event viewer to start a program when a specified message has been logged. You could call your service or load the assemblies in that program.

Would this be a feasible solution for you?

Regards,

Michel

Michel van Engelen
+1  A: 

in the advanced settings of your application pool set your application pool to generate Recycle event log entry every time it is recycled; I think the option is "Specific Time". Then you can use Windows Task Scheduler, create a script or something you want it to run that will hit your site so it can initialize. Set the trigger for the task to an even, set the Event Filter that you want to trigger the task and voila.

Emmanuel