Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can you configure IIS7 to autostart a Windows Process Activation Service (WAS) application when the application pool starts/recycles?

Tags:

c#

.net

iis

iis-7

was

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 achieved 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 application 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 separate service whose job is to ping our application to warm it up.

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

like image 859
Rob Levine Avatar asked Aug 23 '10 09:08

Rob Levine


People also ask

How do I make IIS start automatically?

Configuring Auto-Start with IIS ManagerIn the Connections pane, select the Application Pools node, revealing the Application Pools pane in the main view. Select the application pool for which you wish to enable Auto-Start. Locate the Start Mode option under the General group and set it to AlwaysRunning. Click OK.

What is Windows Process Activation Service used for?

Windows Process Activation Service (WAS) is a tool for managing worker processes that contain applications that host Windows Communication Foundation (WCF) services. Worker processes handle requests that are sent to a Web Server for specific application pools.

What is Windows Activation Service in WCF?

The Windows Process Activation Service (WAS) manages the activation and lifetime of the worker processes that contain applications that host Windows Communication Foundation (WCF) services. The WAS process model generalizes the IIS 6.0 process model for the HTTP server by removing the dependency on HTTP.


1 Answers

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

like image 152
Michel van Engelen Avatar answered Sep 28 '22 05:09

Michel van Engelen