2010-07-30 82 views
5

我有一個客戶端進程,它嘗試使用'BasicHttpBinding'向服務器發出多個併發請求。客戶端正在嘗試向服務器發出10個或更多的併發請求,但服務器日誌表明每次最多隻有2個併發請求正在進行,這顯然會減慢客戶端生成的吞吐量。看起來在客戶端有一些節流。 ,我們已經由服務提供商提供的配置包括一個行爲如下:覆蓋Wcf客戶端最大連接數,防止客戶端遏制

 <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服務,謝謝

回答

3
System.Net.ServicePointManager.DefaultConnectionLimit = 100;