【问题标题】:WCF concurrent connection configurationWCF并发连接配置
【发布时间】: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"/>

  1. 还有什么地方可以设置此连接限制?
  2. 我们是否在 perfmon 中添加了正确的计数器?

更新

我们添加了另一个客户端,并将 WS 服务器正在处理的请求数量增加了一倍。所以这证明了节流是在上游发生的。上游客户端是一个 .NET3.5 ASP.NET 网站。通过 wsHttpBinding 连接到 WCF 服务。

我们已经添加了system.net\connectionManagement\maxconnection,这没有任何影响。

还有哪些其他设置可能会限制到 WCF 服务的传出 ASP.NET 连接?

【问题讨论】:

    标签: wcf .net-3.5 performancecounter perfmon


    【解决方案1】:

    请尝试添加此部分并再次测试性能:

      <system.net>
        <connectionManagement>
          <add address="*" maxconnection="250" />
        </connectionManagement>
      </system.net>
    

    默认值为 2。

    【讨论】:

    • 我已经在客户端中设置了这个设置,但现在也将它添加到了 WCF 服务中。 Current Connections 现在暂时跳到 34,然后又回到 24。我不认为这有帮助,但还是谢谢。
    • 这让我觉得这是对上游服务的连接限制?我们使用 Jmeter 通过网站应用负载,我在那里运行 120 个线程。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2023-04-02
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多