Home » Categories » Multiple Categories |
Common reasons why your application pool may unexpectedly recycle |
Article Number: 129 | Rating: Unrated | Last Updated: Tue, May 15, 2012 at 10:16 PM
|
If your application crashes, hangs and deadlocks it will cause/require the application pool to recycle in order to be resolved, but sometimes your application pool inexplicably recycles for no obvious reason. This is usually a configuration issue ordue to the fact that you're performing file system operations in the application directory. The following is the most common reasons for an application pool to recycle. Application pool settingsIf you check the properties for the application pool you'll see a number of settings for recycling the application pool. In IIS6 they are:
These settings should be pretty self explanatory, but if you want to read more, please take a look atthis MSDN article
The processModel element of machine.configIf you're running IIS5 or the IIS5 isolation mode you'll have to look at the processModel element. The Properties you should pay the closest attention to are:
memoryLimit The default value of memoryLimit is 60. This value is only of interest if you have fairly little memory on a 32 bit machine. 60 stands for 60% of total system memory. So if you have 1 GB of memory the worker process will automatically restart once it reaches a memory usage of 600 MB. If you have 8 GB, on the other hand, the process would theoretically restart when it reaches 4,8 GB, but since it is a 32 bit process it will never grow that big requestLimit
This setting is "infinite" by default, but if it is set to 5000 for example, then ASP.NET will launch a new worker process once it's served 5000 requests timeout The default timeout is "infinite", but here you can set the lifetime of the worker process. Once the timeout is reached ASP.NET will launch a new worker process, so setting this to "00:05:00" would recycle the application every five minutes. Other propertiesThere are other properties within the processModel element that will cause your application pool to recycle, like responseDeadlockInterval. But these other settings usually depend on something going wrong or being out of the ordinary to trigger. If you have a deadlock then that's your main concern. Changing the responseDeadlockIntervalsetting wouldn't do much to resolve the situation. You'd need to deal with the deadlock itself. Editing and updatingASP.NET 2.0 depends on File Change Notifications (FCN) to see if the application has been updated. Depending on the change the application pool will recycle. If you or your application is adding and removing directories to the application folder, then you will be restarting your application pool every time, so be careful with those temporary files Altering the following files will also trigger an immediate restart of the application pool:
Updating the .aspx files, etc.causing a recompile will eventually trigger a restart of the application pool as well. There is a property of the compilation element under system.web that is called numRecompilesBeforeAppRestart. The default value is 20. This means that after 20 recompiles the application pool will recycle A workaround to the sub-directory issueIf your application really depends on adding and removing sub-directories you can use linkd to create a directory junction. Here's how:
Is recycling the application pool really that bad?You really shouldn't have to recycle the application pool, but if you're dealing with a memory leak in your application and need to buy time to fix it, then by all means recycling the application pool could be a good idea |
Attachments
![]()
There are no attachments for this article.
|
Will my Crystal Report X (Crystal Report 10) work on your server?
Viewed 2669 times since Tue, May 1, 2012
How often do you backup my website?
Viewed 4853 times since Tue, May 1, 2012
How to solve ReportViewer error message: "An error has occurred during report processing. Input string was not in a correct format"
Viewed 8220 times since Tue, Jun 18, 2013
I receive this error message: "Unknown file type (binary data)" when trying to deploy my SQL CE database. What did I do wrong?
Viewed 4339 times since Thu, May 3, 2012
My website session times out earlier than expected. Why?
Viewed 4977 times since Tue, May 1, 2012
Will my Crystal Report IX (Crystal Report 9) work on your server?
Viewed 2736 times since Tue, May 1, 2012
I cannot login to my Domain Registration Portal. What should I do?
Viewed 3579 times since Mon, May 7, 2012
My application pool stops working. What is wrong with my site?
Viewed 13252 times since Sun, Feb 15, 2015
You informed me that my Crystal Report has been configured, why do I still receive an error message?
Viewed 3025 times since Tue, May 1, 2012
Do I need a static IP?
Viewed 4939 times since Mon, May 7, 2012
|