1

I have recently deployed a web application that makes use of many web service calls. During deveolpment I did not notice any deadlock or contention, but now when the website is live and heavily visited I get this error in my event log a couple of times a day, and the website also freeze/hangs so that I have to restart IIS.

Application pool 'Default AppPool' exceeded its job limit settings.

I have found some information on this site http://support.microsoft.com/kb/821268, that looks promising, but I need some help regarding the setting values.

Im thinking of tuning these settings:

* maxWorkerThreads
* minWorkerThreads
* maxIoThreads
* minFreeThreads
* minLocalRequestFreeThreads
* maxconnection
* executionTimeout

First it says I have to do them in Machine.configm but couldnt I just do them in Web.config?

Second, what would be the reccomended settings to solve my problem with contention? My (virtual) webserver is running on the following system configuration:

enter image description here

I also know that to solve this permanently, I might have to do something with my code, add caching etc. I welcome tips regarding this aswell.

Martin at Mennt
  • 5,677
  • 13
  • 61
  • 89

2 Answers2

1

Your KB link only relates to versions 2.0 and older of .NET framework.

Deadlocks would not normally happen on an ASP.NET website connecting to web services. So it is very likely that if you use custom locking in the code (or a third-party library), it could be the culprit. So it is important to get to the bottom of that.

Upping the number of threads could help the performance if it is the bottleneck. It is very unlikely to help with thread dead-locks.

In terms of solution, one setting which is of utmost importance is maxConnection which by default is at 2 which means you can only make 2 web service calls at the same time.

Also look into this.

Aliostad
  • 80,612
  • 21
  • 160
  • 208
  • Thank you for your reply. Im currently using .NET Framework 3.5. In terms of the maxConnections, I can add that to Web.config right? Machine.config is just if I want it to relate to all of my sites? – Martin at Mennt Mar 24 '11 at 12:30
  • You can add it to the web.config or machine.config whichever you want. This might in fact solve your problem, fingers crossed :) – Aliostad Mar 24 '11 at 12:31
  • I also changed "Queque Length" on my application pool from 1000 (default) to 12000, based on the tips from this site: http://www.codeproject.com/Tips/99418/Setting-the-best-value-for-Application-pool-Queue-.aspx. Hope it helps aswell. – Martin at Mennt Mar 24 '11 at 13:10
0

Thanks to Aliostad and http://www.guidanceshare.com/wiki/ASP.NET_2.0_Performance_Guidelines_-_Threading I have now tuned my Web.config and added the following settings:

<httpRuntime maxRequestLength="30000" minFreeThreads="88" minLocalRequestFreeThreads="76" />
<processModel maxIoThreads="100" maxWorkerThreads="100" />
<connectionManagement>
   <add address="*" maxconnection="48" />
</connectionManagement>

Does this look okay? I'm not sure why I added maxRequestLength="30000", but it has been like that for a while. Might that be problem, that it is as high as 30000?

EDIT: Looks like I cant add tge processModel tag in my Web.config, I get this error: enter image description here

Martin at Mennt
  • 5,677
  • 13
  • 61
  • 89
  • You need to define this in machine.config unless you change the registration settings to an appropriate allowDefinition value: http://msdn.microsoft.com/en-us/library/ms228245.aspx – andrewbadera Mar 25 '11 at 11:15