Sunday, January 16, 2011

W3WP.EXE hangs with 50% CPU usage

This is an ASP.Net application running on IIS 7. The application hangs with 50% CPU every time making a change to web.config. Customer has to restart IIS services to resolve the problem.
Changing web.config during application running is not a good idea since this triggers application domain recycle. This used to cause short time performance slow down; however, the application should not hang forever. Again, we get 2 hang dumps with 3 minutes interval to investigate this issue.
First of all, we compared the "runaway" result of these 2 dumps, definitely, thread 99c is the culprit.

0:019> !runaway
User Mode Time
 Thread       Time
 19:99c       0 days 0:06:24.906
 17:df8       0 days 0:00:00.656
 ..........
0:019> !runaway
User Mode Time
 Thread       Time
 19:99c       0 days 0:09:46.125
 17:df8       0 days 0:00:00.656
 ............
Thread 99c is the finalizer thread. It in both 2 dumps, it had similar call stacks.
0:019> kc

Read more: AsiaTech: Learning by Practice