Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

If a web application called for itself to be setup with it's application pool to be configured in the applicationHost.config as:

<add name="AppPool" managedRuntimeVersion="v4.0" startMode="AlwaysRunning" />

Would the same result be achieved by just requesting a page from the server every minute? Or does setting startMode to this value have other implications also?

share|improve this question

2 Answers 2

up vote 5 down vote accepted

It appears to be the same. Seemingly, since Microsoft saw developers having to do this, they created this new feature to automatically handle this.

[Developers] then either devise custom scripts to send fake requests to the application to periodically “wake it up” and execute this code before a customer hits it, or simply cause the unfortunate first customer that accesses the application to wait while this logic finishes before processing the request (which can lead to a long delay for them).

ASP.NET 4 ships with a new feature called “auto-start” that better addresses this scenario, and is available when ASP.NET 4 runs on IIS 7.5 (which ships with Windows 7 and Windows Server 2008 R2). The auto-start feature provides a controlled approach for starting up an application worker process, initializing an ASP.NET application, and then accepting HTTP requests.

From Scott Guthrie's Auto-Start ASP.NET Applications (VS 2010 and .NET 4.0 Series).

So unless you're not using IIS 7.5, I'd say just use the built-in functionality.

(And thanks; I didn't know about this feature, but can definitely think of sites that I develop for that could use it.)

share|improve this answer
6  
It's a damn shame they created this feature at the applicationHost.config level. It should be instead at the web.config level. –  Chris Marisic Jan 21 '13 at 21:05

IIS 7.5 includes an additional flag on a Site or Application level called preloadEnabled. Setting this to true will create a fake request to warm up the site. It must be used in conjuncation with autoStart.

autoStart

<add name="{yourapppoolname}" autoStart="true" managedRuntimeVersion="v4.0" managedPipelineMode="Integrated" startMode="AlwaysRunning" />

preloadEnabled

<site name="YOURSITENAMEHERE" id="4″>
  <application path="/" applicationPool="YOURAPPPOOL" preloadEnabled="true">
  <virtualDirectory path="/" physicalPath="C:\inetpub\wwwroot\YOURSITENAME" />
  </application>
</site>
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.