Geeks With Blogs
Dennis Bottjer | MVP

Last year we deployed a new underwriting system.  Since the Fall of 2006 we have been steadily releasing updates to the system.   Supporting the large user-base of this application has required us to improve our debugging and performance monitor skills.  For example, we have become huge fans of unit testing and made strides to better understand memory management and profiling.  To protect the health of the application we needed to understand the recycling of application pools / worker processes.

Thoughts on Application Pool Recycling and Application Availability explains in detail how IIS6 is designed to gracefully transfer client connections to the new worker process.  In general devising a health strategy and recycling application pools is a good idea.  It is a bad idea to be overly aggressive in the recycling of Application Pools.  For example, recycling an application pool every hour would be very aggressive.  If application pool recycling is required that frequently I would profile the application's memory usage to determine how garbage collection is working.  Perhaps objects aren't being disposed of in a timely manor.  It is always a good idea to create a connection or instantiate an object as late as possible and dispose of them as soon as possible.  Furthermore, forced Garbage Collection like the GC Collect method is not recommend b/c it can corrupt Garbage Collection Statistics.

When recycling an application pool for an application that maintains session state, the way in which the session state is maintained should be considered.  For example, maintaining In-Process session state will result in a loss of session state when the Application Pool is recycled.  As a result users may be forced to login to an application again.

Why do I lose ASP Session State on IIS6 further explains the loss of session state when maintaining state in-process. A better strategy may be to store session state out of process.

Posted on Wednesday, May 9, 2007 2:25 PM ASP.NET , Debugging , IIS | Back to top


Comments on this post: Loosing ASP.NET Session State in IIS6

No comments posted yet.
Your comment:
 (will show your gravatar)


Copyright © DennisBottjer | Powered by: GeeksWithBlogs.net