Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ChannelFactory Maximum Connection Pool

I am creating a testing tool to stress load a server. I create many different threads that send seperate requests to the server. It appears to be limited by the ChannelFactory. It bottlenecks on making the actual service call, for example:

_proxy.MyServiceCall(...);

I've tried several different approaches:

  • Using a single static ChannelFactory shared by all the threads
  • Creating a new channel factory per thread
  • Creating a new channel factory per call

All these result in fairly similar performance. There appears to be a global static pool of available connections that the channel factory is using. I've tried looking this up but couldn't find anything. Would you know more about this? Do you think my guess that there is a static pool of connections is correct? If so do you know how that would be configurable?

This is the current configuration for the testing application:

<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>
like image 477
kazvictor Avatar asked Dec 20 '11 17:12

kazvictor


1 Answers

It turned out that all I needed to do is add a configuration for system.net connectionManagement:

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

See: Element (Network Settings)

Note that the problem in this thread is the same one as I have run into: IIS/WAS only handles two requests per client in parallel

like image 111
kazvictor Avatar answered Oct 17 '22 22:10

kazvictor