Monday, January 14, 2013

Deadlock detected : aspnet_isapi.dll

Customers are reporting errors of the variety:
ISAPI 'c:\windows\microsoft.net\framework\v2.0.50727\aspnet_isapi.dll' reported itself as unhealthy for the following reason: 'Deadlock detected'.
Our web applications use ASP.NET, which is a multithreaded application. When tasks execute in parallel (as opposed to serial), but require the same resource, this is a deadlock.


In many cases, the reason for this deadlock is because insufficient threads are allocated by the IIS 6.0 default. To allocate more threads, you open up Internet Information Services (IIS) by typing Start > Run > inetmgr.



Right-click on the application pool that your website is using and you'll get a dialog with 4 tabs:

Recycling, Performance, Health and Identity. On the Recycling tab you get to "reset" the tread by duration, by the number of requests or by clock time.

The recycling schedule should match the loads on your web application.

Select the Performance tab and you get:

This is where you can set the number of threads for the web app. In my case, I've set a total of 5 maximum threads.

Changing these settings will alleviate your Deadlock detected errors for ASP.NET applications.



No comments: