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:

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.
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.