Scenario
From time to time, asp.net application response is very slow on Windows Server 2003
Rants and the resolution
After turning on recycle events, logged message in application event log was Event message: Application is shutting down. Reason: Unknown. Slow response is always timed with this message in the application event log so that confirmed that Application Pool is terminating so no wonder asp.net response is slow from time to time.
However, the only missing piece was why? Since, the Reason is unknown
. This application pool is configured for web garden with 6 app pools in it so we decided to attach debugger in production box to 2 worker processes.
If you are just starting out with debugging or have not read John Robbins Book on debugging, I would like to stress the followings when using debugger in production environment
1. By Default, ADPlus writes the call stack on first-chance exception. Walking call stack also results in Symbol loading, symbol loading along with the stack walking causes a performance hit when a debugger is attached. The last thing you want in production environment is to cause performance hit because of debugger.
2. Don’t just use ADPlus script to attach a debugger to the worker process by name because it will attach the debugger to each worker process in your production server causing further performance hit.
3. Don’t use DebugDiag in production environment unless you really have a good reason for it.
