【问题标题】:What happens in WCF if there are additional request that the limit set in MaxConcurrentCalls?如果在 MaxConcurrentCalls 中设置了限制的附加请求,WCF 会发生什么?
【发布时间】:2023-03-24 05:31:01
【问题描述】:

我正在尝试限制对我的 WCF 服务的最大并发调用。我将它们限制如下:

<behaviors>
      <serviceBehaviors>
        <behavior  name="Throttled">
          <serviceThrottling
            maxConcurrentCalls="4"
          />
        </behavior>
      </serviceBehaviors>
</behaviors>

我的问题如下:

  1. 如果有超出“maxConcurrentCalls”中设置的额外请求会发生什么?他们会被排队还是被拒绝?

  2. 当达到 maxconcurrent 调用时,用户会收到任何错误/异常吗?

  3. 我希望将其他请求排队,并且用户不应收到任何错误或异常。应该怎么做?

【问题讨论】:

    标签: wcf service throttling


    【解决方案1】:

    节流旨在避免过度分配和使用资源。启用 Throttle 设置后,如果超过限流设置,WCF 会自动将调用者放入等待队列,然后依次处理调用。如果客户端在等待期间超时。你会得到 TimeoutException。简而言之,Throttle 旨在防止系统崩溃,但仅限于高负载占用一小部分负载时。如果长时间处于高负载状态,Throttle 最终导致所有调用者超时,建议一开始就考虑设计

    WCF Service Throttling

    https://blogs.msdn.microsoft.com/wenlong/2009/07/26/wcf-4-higher-default-throttling-settings-for-wcf-services/

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2021-05-17
      • 2011-08-06
      • 2019-09-27
      • 2010-10-16
      • 2015-09-20
      • 1970-01-01
      • 2020-04-11
      相关资源
      最近更新 更多