【问题标题】:Override Wcf Client max connections, prevent client side throttling覆盖 Wcf 客户端最大连接数,防止客户端限制
【发布时间】:2011-03-23 03:34:15
【问题描述】:

我有一个客户端进程尝试使用“BasicHttpBinding”向服务器发出多个并发请求。客户端尝试向服务器发出 10 个或更多并发请求,但服务器日志显示在任何时候最多只有 2 个并发请求正在进行,这显然会减慢客户端生成的吞吐量。客户端似乎正在进行一些节流。 服务提供商提供给我们的配置包含如下行为:

        <basicHttpBinding>
            <binding name="BasicHttpBinding_IService" closeTimeout="00:01:00"
                openTimeout="00:01:00" receiveTimeout="00:10:00" sendTimeout="01:00:00"
                allowCookies="false" bypassProxyOnLocal="false" hostNameComparisonMode="StrongWildcard"
                maxBufferSize="2047483647" maxBufferPoolSize="524288" maxReceivedMessageSize="2047483647"
                messageEncoding="Text" textEncoding="utf-8" transferMode="Buffered"
                useDefaultWebProxy="true">
                <readerQuotas maxDepth="32" maxStringContentLength="8192" maxArrayLength="1073741823"
                    maxBytesPerRead="4096" maxNameTableCharCount="16384" />
                <security mode="TransportCredentialOnly">
                    <transport clientCredentialType="Windows" proxyCredentialType="None"
                        realm="" />
                    <message clientCredentialType="UserName" algorithmSuite="Default" />
                </security>
            </binding>
        </basicHttpBinding>

另外,我们在客户端有如下连接管理入口:

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

那么我需要做些什么来防止在客户端上发生限制,以便对 WCF 服务的最大并发请求可能超过 2 个,谢谢

【问题讨论】:

    标签: wcf-client throttling


    【解决方案1】:
    System.Net.ServicePointManager.DefaultConnectionLimit = 100;
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2016-03-31
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多