Recycle worker process IIS 6.0
November 26th, 2007 by Rémy Blättler
Yesterday we had a customer that could not complete his order, during the checkout. Digging a bit deeper I found out that the IIS Worker Process restarted at exactly the same time.
Log in the Event Viewer:
A worker process with process id of ’7232′ serving application pool ‘DefaultAppPool’ has requested a recycle because the worker process reached its allowed processing time limit.
Doesn’t sound very good, does it? As it turns out, this is default behavior and should protect IIS from Memory Leaks and other bad things in you application.
Luckily you can adjust this setting. In my case it was set to 1740 min (which is about once a day), which is not a very good solution. The problem is, that every time the worker process restarts, you loose all your asp.net session states. Now you have several alternatives:
- Keep your session state out of process. Either via Session State Service or SQL Server, but both add complexity and are slower.
- You can the recycle behavior. I’ve set it to restart at 22:00. This is 04:00 in Switzerland. Hopefully all clients in the USA and in Switzerland are done ordering at this time.
Nice would be if the Session State could be transferred from one process to the next, but that is not an option yet.
There is a nice forum post about the IIS 6.0 Recycling Tab:
http://forums.asp.net/t/623320.aspx
And about retaining your session state:
http://www.ondotnet.com/pub/a/dotnet/2003/03/24/sessionstate.html
Lucky for us, the customer actually called and we were able to save this order.
Update:
