Question

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>
Was it helpful?

Solution

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

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top