我有一个WCF服务(内置在.NET框架3.5中)托管在IIS6.0上。
代码流程如下所示
服务)调用WCF服务
我正在对我的WCF服务进行负载测试,以定义阈值。观察结果如下:
在1分钟内对WCF服务进行了大约3次1024次请求的迭代,成功通过。完成每次迭代所需的时间大约为25-30分钟。然而,从第四次迭代中可以看到批量失败。大约50%的请求失败,出现以下异常。
异常-线程正被中止。
堆栈跟踪
21_10_2016_09_30_52,9:30:52 AM,Information,Thread name- apSwTTbLTETfwT3y Stack trace in ProcessTestConversion method - at System.Threading.WaitHandle.WaitOneNative(SafeHandle waitableSafeHandle, UInt32 millisecondsTimeout, Boolean hasThreadAffinity, Boolean exitContext)
at System.Threading.WaitHandle.InternalWaitOne(SafeHandle waitableSafeHandle, Int64 millisecondsTimeout, Boolean hasThreadAffinity, Boolean exitContext)
at System.Threading.WaitHandle.WaitOne(Int32 millisecondsTimeout, Boolean exitContext)
at System.Net.LazyAsyncResult.WaitForCompletion(Boolean snap)
at System.Net.Connection.SubmitRequest(HttpWebRequest request, Boolean forcedsubmit)
at System.Net.ServicePoint.SubmitRequest(HttpWebRequest request, String connName)
at System.Net.HttpWebRequest.SubmitRequest(ServicePoint servicePoint)
at System.Net.HttpWebRequest.GetRequestStream(TransportContext& context)
at System.Net.HttpWebRequest.GetRequestStream()
.
.(My function calls stack trace)
.
.
我试图解决这个问题的更改如下:
<behavior>
<serviceThrottling maxConcurrentCalls="2000"
maxConcurrentInstances ="2400"
maxConcurrentSessions ="400"/>
</behavior>
在web.config中
<system.web>
<compilation debug="false" />
<httpRuntime executionTimeout="1800"/>
</system.web>
在web.config中
<system.net>
<connectionManagement>
<add address = "*" maxconnection = "100" />
</connectionManagement>
</system.net>
在web.config中
ServicePointManager.DefaultConnectionLimit = 100; (Change in code)
我已经按照StackOverflow上许多人的建议,将应用程序池的IdleTimeout属性设置为0。
在任何地方使用这些小溪,我都会在所有的地方进行处理。所以所有的小溪都关闭了。
有人能告诉我是谁在中止线程吗?为什么?有什么方法或工具可以追踪线程中止启动的原因吗?
https://stackoverflow.com/questions/40178498
复制相似问题