Steve Hebert's Development Blog

Sponsors

The Lounge

Currently Reading

My Amazon Wish List

Advertisement

Images in this post missing? We recently lost them in a site migration. We're working to restore these as you read this. Should you need an image in an emergency, please contact us at imagehelp@codebetter.com
Recycling the ASP.NET worker process at set intervals
Many ASP.NET developers are not aware of the ability to restart the ASP.NET worker process at given intervals in code.  While IIS6.0 makes a number of these features available through the UI, most of the features can be used in IIS5 and 5.1 as well.  I've found this useful for rogue components that are consuming memory and this provides a bandaid fix until the root problem is identified.
 
The <processModel> model configuration setting allows you to set limits that any given running ASPNET_WP process will operate under until it's recycled.  For instance, if I set requestLimit="10000", a given ASPNET_WP process will run until 10000 requests have been serviced.  At that time, a new ASPNET_WP service will start and requests will be directed at it.  The old ASPNET_WP process will then be shut down.
 
This setting can be made in the machine.config file and affects all processes .Net processes on that machine.  The related MSDN article can be found here.
 

Posted 03-07-2005 1:23 PM by shebert

[Advertisement]

Comments

ben wrote re: Recycling the ASP.NET worker process at set intervals
on 03-07-2005 5:45 PM
We use something similar to this, you can set a limit on the amount of memory that the process can use until it recycles automatically. Its a setting in the 'processModel' section of the machine.config file where you specify the percentage of system memory to allow the process to use.
Stephen Hebert wrote re: Recycling the ASP.NET worker process at set intervals
on 03-08-2005 5:47 AM
Thanks Ben,

Your example is much better. The requestLimit=n can be applied better to things like connection leaks as a bandaid while tracking down the problem.
TrackBack wrote Recycling the ASP.NET worker process at set intervals (from: Steve Hebert)
on 03-16-2005 7:49 PM
Steve Hebert's Development Blog wrote Dear Microsoft... please kill in-memory session state.. Sincerely...
on 04-07-2005 8:03 AM
I'm generally not a fan of cork-on-a-fork approaches to protecting programmers, but here's one case where...