覆盖Wcf客户端最大连接,防止客户端限制

时间:2010-07-30 08:54:25

标签: wcf-client throttling

我有一个客户端进程尝试使用'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>

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

1 个答案:

答案 0 :(得分:4)

System.Net.ServicePointManager.DefaultConnectionLimit = 100;
相关问题