2011-12-20 85 views
5

我正在創建一個測試工具來強調加載服務器。我創建了許多不同的線程,將單獨的請求發送到服務器。它似乎受到ChannelFactory的限制。它瓶頸上使得實際服務調用,例如:ChannelFactory最大連接池

_proxy.MyServiceCall(...); 

我試過幾種不同的方法:

  • 使用的所有線程
  • 共享的單一靜態的ChannelFactory創建新通道每個線程
  • 創建每次調用一個新的通道工廠廠

所有這些結果表現相當類似。似乎有一個渠道工廠正在使用的全球靜態可用連接池。我試過了,但找不到任何東西。你會更瞭解這個嗎?你認爲我的猜測是有一個靜態的連接池是正確的嗎?如果是這樣,你知道如何配置?

這是測試應用程序的當前配置:

<configuration> 
    <system.serviceModel> 
    <client> 
     <endpoint binding="wsHttpBinding" bindingConfiguration="SynchronizationServiceBinding" contract="My.Namespace.ISynchronizationService" name="ClientBinding"> 
     </endpoint> 
    </client> 
    <bindings> 
     <wsHttpBinding> 
     <binding name="SynchronizationServiceBinding" maxBufferPoolSize="2147483647" maxReceivedMessageSize="10485760"> 
      <security mode="Transport"> 
      <transport clientCredentialType="None"/> 
      </security> 
      <reliableSession enabled="false"/> 
      <readerQuotas maxArrayLength="1000000"/> 
     </binding> 
     </wsHttpBinding> 
    </bindings> 
    <serviceHostingEnvironment multipleSiteBindingsEnabled="true" /> 
    </system.serviceModel> 
<startup><supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0"/></startup> </configuration> 
+1

您是否配置了[throttling](http://msdn.microsoft.com/en-us/library/ms735114%28v=vs.90%29.aspx)? – oleksii

+0

我沒有權限訪問服務器配置,但我知道服務器能夠處理更多的調用,然後測試工具當前能夠發送,所以限制在測試工具上。我已經添加了測試工具的配置。 – kazvictor

回答

4

原來,所有我需要做的就是添加了system.net connectionManagement的配置:

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

參見: Element (Network Settings)

請注意,此線程中的問題與我遇到的問題相同:IIS/WAS only handles two requests per client in parallel

+0

謝謝!我正在嘗試做與你完全相同的事情,並正在考慮創建多個流程來解決此問題。 – Mas