【问题标题】:WCF PollingDuplex With High Callback Calls cause Service Too Busy Exception for new Service Subscriptions具有高回调调用的 WCF PollingDuplex 导致新服务订阅的服务太忙异常
【发布时间】:2011-03-24 17:06:13
【问题描述】:

我目前正在尝试使用具有 SilverLight 4.0 的 PollingDuplex 绑定构建双工 WCF 服务。

我的服务每 1 秒为每个连接的客户端调用几个回调方法。 但是,在 2 个客户端连接后,新客户端得到“位于...的服务太忙”

我的服务使用这种行为:

[ServiceBehavior(InstanceContextMode = InstanceContextMode.Single, 
    ConcurrencyMode = ConcurrencyMode.Multiple)]

WCF 绑定配置:

<pollingDuplexHttpBinding>
  <binding name="" maxOutputDelay="00:00:01" serverPollTimeout="00:05:00"
    inactivityTimeout="02:00:00" duplexMode="MultipleMessagesPerPoll"
    maxBufferPoolSize="2147483647" maxBufferSize="2147483647"
    maxReceivedMessageSize="2147483647">
    <readerQuotas maxDepth="2147483647" maxStringContentLength="2147483647"
      maxArrayLength="2147483647" maxBytesPerRead="2147483647"
      maxNameTableCharCount="2147483647" />
  </binding>
</pollingDuplexHttpBinding>

服务行为:

<behavior name="Push">
  <serviceMetadata httpGetEnabled="true"/>
  <serviceDebug includeExceptionDetailInFaults="true"/>
  <serviceThrottling maxConcurrentCalls="2147483647"
    maxConcurrentInstances="2147483647" 
    maxConcurrentSessions="2147483647"/>
</behavior>

服务定义:

<services>
  <service name="PushService" behaviorConfiguration="Push">
    <endpoint address="" binding="pollingDuplexHttpBinding"
      contract="PushService"/>
    <endpoint address="mex" binding="mexHttpBinding" 
      contract="IMetadataExchange"/>
  </service>
</services>

有什么帮助吗?这个例外让我抓狂!

【问题讨论】:

    标签: c# .net wcf silverlight-4.0 pollingduplexhttpbinding


    【解决方案1】:

    我认为这个问题可能与“maxconnection”默认值 2:来自 System.Net。 您可以尝试在服务和客户端配置中添加以下配置并检查它是否可以改善结果,

    上述配置适用于客户端应用程序,但请记住 PollingDuplex 是一个双工通道,其中服务充当客户端进行回调操作。

    请找到文龙的漂亮博客,其中解释了为什么需要上述配置, http://blogs.msdn.com/b/wenlong/archive/2009/02/08/why-only-two-concurrent-requests-for-load-testing.aspx

    【讨论】:

      【解决方案2】:

      我注意到我的 PollingDuplex 软件在使用一个 Internet Explorer 时限制为 10 个客户端。 Windows 2008 Server R2 机器和具有许多设置的 Web.config 仍然存在限制:

      用于绑定: 绑定名称="pollingDuplexBinding" maxConnections="100"

      对于 serviceBehaviors 行为: serviceThrottling maxConcurrentCalls="1000" maxConcurrentInstances="1000" maxConcurrentSessions="1000"

      用于轮询Duplex maxPendingSessions="2147483647" maxPendingMessagesPerSession="2147483647"

      但是当我尝试使用不同的客户时:

      • 服务器上 IE 上的 6 个客户端
      • 6 个客户端在不同的客户端机器上的 IE 上
      • 此客户端计算机上的 FireFox 上有 4 个客户端

      它奏效了。因此,相同的客户端连接存在某种限制。

      【讨论】:

        猜你喜欢
        • 2011-12-24
        • 1970-01-01
        • 2011-03-20
        • 2010-12-11
        • 2010-10-28
        • 2011-09-26
        • 1970-01-01
        • 1970-01-01
        • 2011-05-04
        相关资源
        最近更新 更多