Alternative to application pool startMode=”AlwaysRunning”

iis-7

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?

Best Answer

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.)