65.9K
CodeProject is changing. Read more.
Home

Configuring machine.config to recycle aspnet_wp

starIconstarIcon
emptyStarIcon
starIcon
emptyStarIconemptyStarIcon

2.33/5 (6 votes)

Jan 17, 2006

1 min read

viewsIcon

26820

Configuring machine.config to recycle aspnet_wp

Configuring machine.config to recycle aspnet_wp

There has been a lot of times when we feel that our application is slowing down or the ASP.Net worker process is not working as its best. Although ASP.NET does recycle its process after certain number of requests or memory Limit but there are times when you feel that you could control these parameters and explicitly restart the worker process.

It is possible to restart the worker process explicitly after a certain number of requests.

In Machine.config under <configuration> <system.web><procesmodel> we have an attribute called requestLimit.

Set this request Limit to the number of requests after you want to recycle your worker process. It can be set to Infinite or any particular number. The default setting is 5000.

Suppose if we set to it say 10 then you will notice that after every 10 requests aspnet_wp process will be recycled. You can note the process id's to feel the change.

Second reason coz of which we may want our process to be recycled is because of high consumption of memory.

In Machine.config under <configuration> <system.web><procesmodel> we have an attribute called memoryLimit. Set the threshold to the amount you want. The default is 60 i.e. 60%. The moment this threshold is reached aspnet_wp will be recycled.

Before we make any changes to the machine.config we must remember that these changes are going to affect all the applications on that machine coz we are these changes at the core level. Hence after making these changes we should bench mark all our applications.