We have a .NET 3.5 WCF service hosted on IIS 6.0 which has a basicHttp binding. This is consumed by 2 .NET and 2 ASP applications. When the 4th application (irrespective of .NET or ASP) is started and tries consuming it, the w3wp.exe peaks at 99% and stays there after few seconds.
Based on this article, we tried adding the following to the .NET 2.0 machine.config but this does not have any effect.
<processModel autoConfig="false" maxWorkerThreads="500" maxIoThreads="500" minWorkerThreads="2"/>
<httpRuntime minFreeThreads="250" minLocalRequestFreeThreads="250"/>
Any ideas?
EDIT: Added the crash analysis report info:
Warning 1: The following threads in w3wp.exe_v2.0 Applications_PID_2856_Date__12_08_2011__Time_12_13_39PM_876_Manual Dump.dmp are waiting on a synchronous WCF request to execute
4.35% of threads blocked
Please click on the Actual Thread to see the desnitation WCF Thread or check WCF Request report to find out the thread id for the actual WCF thread for which this thread is waiting on. For more details on this WCF Behavior check out the blog on WCF Request Throttling and Server Scalability.
Thread 16 - System ID 3920
Entry point mscorwks!ThreadpoolMgr::intermediateThreadProc
Create time 12/8/2011 12:10:44 PM
Time spent in user mode 0 Days 00:00:00.031
Time spent in kernel mode 0 Days 00:00:00.140
This thread is waiting on a synchronous WCF request to execute
The destination WCF Thread for this ASP.NET worker thread is 14
.NET Call Stack
Function
System.Threading.WaitHandle.WaitOneNative(Microsoft.Win32.SafeHandles.SafeWaitHandle, UInt32, Boolean, Boolean)
System.Threading.WaitHandle.WaitOne(Int64, Boolean)
System.Threading.WaitHandle.WaitOne(Int32, Boolean)
System.Threading.WaitHandle.WaitOne()
System.ServiceModel.Activation.HostedHttpRequestAsyncResult.ExecuteSynchronous(System.Web.HttpApplication, Boolean)
System.ServiceModel.Activation.HttpModule.ProcessRequest(System.Object, System.EventArgs)
System.Web.HttpApplication+SyncEventExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()
System.Web.HttpApplication.ExecuteStep(IExecutionStep, Boolean ByRef)
System.Web.HttpApplication+ApplicationStepManager.ResumeSteps(System.Exception)
System.Web.HttpApplication.System.Web.IHttpAsyncHandler.BeginProcessRequest(System.Web.HttpContext, System.AsyncCallback, System.Object)
System.Web.HttpRuntime.ProcessRequestInternal(System.Web.HttpWorkerRequest)
System.Web.HttpRuntime.ProcessRequestNoDemand(System.Web.HttpWorkerRequest)
System.Web.Hosting.ISAPIRuntime.ProcessRequest(IntPtr, Int32)
Sounds like your load is somehow generating a lot of threads and thereby causing the CPU to work like crazy to keep up with them. Since your edit references a crash dump, you may be able to use WinDbg to find out what is going on.
If you’re familiar with WinDbg and have it already installed and configured (otherwise spend some quality time with the tutorials here) , try the following:
This will show how many threads were created. The
.prefer_dml 1enables HTML like links to be generated so you can just click to run an appropriate command in the output. Next run:to see which threads may be blocked. It should show which thread is doing the blocking. Next run something like this to get the stack for thread 32 if that one were the culprit:
It should contain information on the code running on that thread which is doing the blocking. Saying working with WinDbg is very archane is a enormous understatement but it is worth the effort to help debug issues like yours. Good luck!