【发布时间】:2017-03-29 07:17:33
【问题描述】:
我们有一个新的 Win 2012 服务器托管旧的 .NET 3.5 WCF 服务(有 22 个端点和可能有几百个操作),我们遇到了一些性能问题并希望控制连接数。
我们附加了 perfmon Web Service/Current Connections 计数器,发现该值反复上升到稳定的 24 个连接(偶尔达到 25 个峰值)。
我们已尝试使用system.ServiceModel\behaviors\serviceBehaviors\behavior\serviceThrottling 管理连接数。我们尝试了默认值、低值、推荐值和高值:
<!-- default -->
<serviceThrottling />
<!-- low -->
<serviceThrottling maxConcurrentCalls="5" maxConcurrentSessions="10" maxConcurrentInstances="15"/>
<!-- recommended (2 processors) -->
<serviceThrottling maxConcurrentCalls="32" maxConcurrentSessions="200" maxConcurrentInstances="232"/>
<!-- high-->
<serviceThrottling maxConcurrentCalls="2000" maxConcurrentSessions="2000" maxConcurrentInstances="2000"/>
- 还有什么地方可以设置此连接限制?
- 我们是否在 perfmon 中添加了正确的计数器?
更新
我们添加了另一个客户端,并将 WS 服务器正在处理的请求数量增加了一倍。所以这证明了节流是在上游发生的。上游客户端是一个 .NET3.5 ASP.NET 网站。通过 wsHttpBinding 连接到 WCF 服务。
我们已经添加了system.net\connectionManagement\maxconnection,这没有任何影响。
还有哪些其他设置可能会限制到 WCF 服务的传出 ASP.NET 连接?
【问题讨论】:
标签: wcf .net-3.5 performancecounter perfmon