Web Development Time Saver - InformationWeek

InformationWeek is part of the Informa Tech Division of Informa PLC

This site is operated by a business or businesses owned by Informa PLC and all copyright resides with them.Informa PLC's registered office is 5 Howick Place, London SW1P 1WG. Registered in England and Wales. Number 8860726.

IoT
IoT
Mobile // Mobile Applications
News
9/30/2010
06:35 PM
50%
50%

Web Development Time Saver

IIS 7.5's Application Warm-Up module eliminates delays By Dino Esposito

Web applications and Web sites built using ASP .NET often face a common problem.

They're often hosted in Microsoft IIS application pools that let resources such as worker processes and settings be shared, to minimize development and maintenance. That's fine-until requests for shared services cause delays as the application pool recycles and .Net and database connections are initialized. IIS 7.5 addresses this problem with the IIS Application Warm-Up module.

IIS App Warm-Up is natively available with IIS 7.5 on Windows Server 2008 R2 and Windows 7; it's available as an extension for IIS 7. Without warm-up enabled, application pool recycling consists of killing the current instance of the worker process and starting a new one. While this is going on, IIS keeps getting requests, causing even more delays. With warm-up enabled, the two operations occur in reverse order-a new worker process starts up, then the old one is killed. When the new process is up and running, it notifies IIS that it's ready to receive requests. At this point, IIS shuts down the old worker process and completes the recycle in a way that doesn't slow down things for the user.

To configure an application pool for warm-up, edit the applicationHost .config file under the IIS directory. The folder is \inetsrv\config under the Windows System32 folder. Change the value of the startMode attribute of the application pool entry from OnDemand to AlwaysRunning. Here's the code snippet:

Because an application pool can host multiple ASP.NET applications, you also need to specify applicability for each particular application. You can do this either by using the IIS Manager interface or entering the following script into the applicationHost.config file:

...

Alternatively, from within IIS Manager, navigate to the application and select its warm-up applet. Note that it's configured at the host level. Changes are saved to the applicationHost.config file, not the web.config file. This means that the administrator or hosting company decides whether warm-up is allowed and what policies should be applied.

Warm-up is a way to execute some code before the app becomes available, and to preload and possibly cache some data. You can specify the code that makes this happen at the IIS level. The warm-up applet in IIS Manager will give you a dialog box where you enter the URL to the page on your site that will execute the preloading code. You also indicate a range of acceptable HTTP status codes that indicate the success of the operation.

This works with IIS 7 and IIS 7.5. With IIS 7.5, you can also define an auto-start service provider, a managed component that runs any required preloading code for a given application. An auto-start provider is a class that implements the IProcessHost PreloadClient interface. Such providers are registered in the IIS configuration using this code:

...

There's no visual interface to configure this aspect. You either edit the configuration file manually or resort to the IIS Manager's generic configuration editor.

Dino Esposito is a Windows consultant and author on .NET development. Write to us at [email protected]

We welcome your comments on this topic on our social media channels, or [contact us directly] with questions about the site.
Comment  | 
Print  | 
More Insights
InformationWeek Is Getting an Upgrade!

Find out more about our plans to improve the look, functionality, and performance of the InformationWeek site in the coming months.

News
How CIO Roles Will Change: The Future of Work
Jessica Davis, Senior Editor, Enterprise Apps,  7/1/2021
Commentary
A Strategy to Aid Underserved Communities and Fill Tech Jobs
Joao-Pierre S. Ruth, Senior Writer,  7/9/2021
Slideshows
10 Ways AI and ML Are Evolving
Lisa Morgan, Freelance Writer,  6/28/2021
White Papers
Register for InformationWeek Newsletters
Video
Current Issue
Monitoring Critical Cloud Workloads Report
In this report, our experts will discuss how to advance your ability to monitor critical workloads as they move about the various cloud platforms in your company.
Slideshows
Flash Poll