我们有一个与.NET Webforms后端通信的AngularJS应用程序;它对许多系统执行一堆AJAX请求,并将大量信息合并到一个页面中,从而使用户可以更快地获取信息。该页面加载非常快,但是有一个有时挂起的AJAX请求(GetPatientRadiology)-即,如果我进入AppPool中的View Current Requests,我会看到它位于AquireRequestState中
AppPool的内存仍然很低(正常行为),但是,发生这种情况时,AppPool的CPU使用率跳升到大约30%(此应用程序不常见)。直到我回收appPool之前,它一直都是这样,出于某种原因,它似乎从未超时-我们已经观察到它运行了17个小时以上。
应用程序每天为该页面提供服务(并因此发出GetPatientRadiology请求),大约每天22,000次,并且每天似乎发生这种情况
它在Windows 2008R2服务器(IIS7.5)和ASP.NET 4.6.1上运行。是的,我知道它很旧...但是我们受困于一些旧设备:(
我已经阅读了数十篇文章,但是看不到有什么特别的帮助;有建议使用我已经完成的MS Debug Diags,并在生产中捕获该过程。下面是其中的一部分,但我不知道从哪里开始解释它,希望对您有所帮助。
按CPU时间排名前5的线程
Thread ID: 44 Total CPU Time: 00:00:07.222 Entry Point for Thread: clr!StrongNameFreeBuffer+35dc0
Thread ID: 3 Total CPU Time: 00:00:06.972 Entry Point for Thread: w3tp+2040
Thread ID: 46 Total CPU Time: 00:00:06.145 Entry Point for Thread: clr!StrongNameFreeBuffer+35dc0
Thread ID: 5 Total CPU Time: 00:00:05.911 Entry Point for Thread: w3tp+2040 ```
Thread 43 - System ID 5224
Entry point clr!StrongNameFreeBuffer+35dc0
Create time 8/11/2019 11:22:24 a.m.
Time spent in user mode 0 Days 00:05:02.595
Time spent in kernel mode 0 Days 00:05:06.853
This thread is not fully resolved and may or may not be a problem. Further analysis of these threads may be required.
.NET Call Stack
System_Data_ni!DomainNeutralILStubClass.IL_STUB_PInvoke(System.Data.Odbc.OdbcStatementHandle,UInt16,SQL_C,System.Data.Odbc.CNativeBuffer,IntPtr,IntPtr ByRef)+e8
[[InlinedCallFrame] (System.Data.Common.UnsafeNativeMethods.SQLGetData)] System.Data.Common.UnsafeNativeMethods.SQLGetData(System.Data.Odbc.OdbcStatementHandle,IntPtrByRef)
System_Data_ni!System.Data.Odbc.OdbcStatementHandle.GetData(Int32,Int32,IntPtr ByRef)+30
System_Data_ni!System.Data.Odbc.OdbcDataReader.GetData(Int32,Int32 ByRef)+74
System_Data_ni!System.Data.Odbc.OdbcDataReader.internalGetString(Int32)+1d4
System_Data_ni!System.Data.Odbc.OdbcDataReader.Getvalue(Int32,System.Data.Odbc.TypeMap)+73
System_Data_ni!System.Data.Odbc.OdbcDataReader.Getvalue(Int32)+43
_Default.GetPatientRadiology(System.String)+330
[[DebuggerU2MCatchHandlerFrame]]
[[HelperMethodFrame_PROTECTOBJ] (System.RuntimeMethodHandle.InvokeMethod)] System.RuntimeMethodHandle.InvokeMethod(System.Object,System.Object[],System.Signature,Boolean)
mscorlib_ni!System.Reflection.RuntimeMethodInfo.UnsafeInvokeInternal(System.Object,System.Object[])+80
mscorlib_ni!System.Reflection.RuntimeMethodInfo.Invoke(System.Object,System.Reflection.Bindingflags,System.Reflection.Binder,System.Globalization.CultureInfo)+8e
system.web.Script.Services.WebServiceMethodData.CallMethod(System.Object,System.Collections.Generic.IDictionary`2)+139
system.web.Script.Services.RestHandler.InvokeMethod(system.web.HttpContext,system.web.Script.Services.WebServiceMethodData,System.Collections.Generic.IDictionary`2)+74
system.web.Script.Services.RestHandler.ExecuteWebServiceCall(system.web.HttpContext,system.web.Script.Services.WebServiceMethodData)+5d
system.web.Handlers.ScriptModule.OnPostAcquireRequestState(System.Object,System.EventArgs)+120
System_Web_ni!system.web.HttpApplication+SyncEventExecutionStep.system.web.HttpApplication.IExecutionStep.Execute()+8b
System_Web_ni!system.web.HttpApplication.ExecuteStepImpl(IExecutionStep)+c3
System_Web_ni!system.web.HttpApplication.ExecuteStep(IExecutionStep,Boolean ByRef)+58
System_Web_ni!system.web.HttpApplication+PipelinestepManager.ResumeSteps(System.Exception)+5bc
System_Web_ni!system.web.HttpApplication.BeginProcessRequestNotification(system.web.HttpContext,System.AsyncCallback)+79
System_Web_ni!system.web.httpruntime.ProcessRequestNotificationPrivate(system.web.Hosting.IIS7WorkerRequest,system.web.HttpContext)+1db
System_Web_ni!system.web.Hosting.PipelineRuntime.ProcessRequestNotificationHelper(IntPtr,Int32)+3cd
System_Web_ni!system.web.Hosting.PipelineRuntime.ProcessRequestNotification(IntPtr,Int32)+13
System_Web_ni!DomainNeutralILStubClass.IL_STUB_ReversePInvoke(Int64,Int64,Int32)+52
System_Web_ni!DomainNeutralILStubClass.IL_STUB_PInvoke(IntPtr,system.web.RequestNotificationStatus ByRef)+7e
[[InlinedCallFrame] (system.web.Hosting.UnsafeIISMethods.MgdIndicateCompletion)] system.web.Hosting.UnsafeIISMethods.MgdIndicateCompletion(IntPtr,system.web.RequestNotificationStatusByRef)
System_Web_ni!system.web.Hosting.PipelineRuntime.ProcessRequestNotificationHelper(IntPtr,Int32)+595
System_Web_ni!system.web.Hosting.PipelineRuntime.ProcessRequestNotification(IntPtr,Int32)+52
[[ContextTransitionFrame]]
Full Call Stack
ntdll!NtSetEvent+a
KERNELBASE!SetEvent+c
sqora32+17a3
sqora32!SQLGetData+175
odbc32!SQLGetData+897
System_Data_ni!DomainNeutralILStubClass.IL_STUB_PInvoke(System.Data.Odbc.OdbcStatementHandle,System.Data.Odbc.TypeMap)+73
System_Data_ni!System.Data.Odbc.OdbcDataReader.Getvalue(Int32)+43
_Default.GetPatientRadiology(System.String)+330
clr!LogHelp_LogAssert+2043
clr!LogHelp_LogAssert+1ef8
clr!DllUnregisterServerInternal+60f46
clr!DllUnregisterServerInternal+613ff
[[DebuggerU2MCatchHandlerFrame]]
[[HelperMethodFrame_PROTECTOBJ] (System.RuntimeMethodHandle.InvokeMethod)] System.RuntimeMethodHandle.InvokeMethod(System.Object,System.Collections.Generic.IDictionary`2<System.String,System.Object>)+139
system.web.Script.Services.RestHandler.InvokeMethod(system.web.HttpContext,System.Object>)+74
system.web.Script.Services.RestHandler.ExecuteWebServiceCall(system.web.HttpContext,Int32)+52
clr+21fe
webengine4!PerfDecrementGlobalCounter+33f
webengine4!RegisterModule+3cca
webengine4!PerfDecrementGlobalCounter+fb
webengine4!MgdWebSocketWriteFragment+36f
iiscore+2e48
iiscore+46a4
iiscore+a775
iiscore+1ee5
iiscore+a81c
webengine4!STRU::Unescape+501
webengine4!MgdIndicateCompletion+22
System_Web_ni!DomainNeutralILStubClass.IL_STUB_PInvoke(IntPtr,Int32)+52
clr+2453
clr!DllUnregisterServerInternal+4cb3a
clr!LogHelp_LogAssert+5ca4
[[ContextTransitionFrame]]
clr!DllUnregisterServerInternal+4cbe5
clr+23fd
webengine4!PerfDecrementGlobalCounter+33f
webengine4!PerfDecrementGlobalCounter+292
clr!LogHelp_LogAssert+49ff
clr!LogHelp_LogAssert+35fc
clr!LogHelp_LogAssert+33a5
clr!StrongNameFreeBuffer+35e3f
kernel32!BaseThreadInitThunk+d
ntdll!RtlUserThreadStart+1d
非常感谢,
大卫