ChannelFactory Maximum Connection Pool
Asked Answered
I

1

6

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>
Ionopause answered 20/12, 2011 at 17:32 Comment(2)
Do you have throttling configured?Deliciadelicious
I don't have access to the server configuration but I know for a fact that the server is able to process many more calls then then test tool is currently able to send so the limit is somewhere on the testing tool. I've added the configuration for the testing tool.Ionopause
I
6

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

Ionopause answered 21/12, 2011 at 1:59 Comment(1)
Thanks! I was trying to do the exact same thing as you, and was contemplating creating multiple processes to get around this.Joke

© 2022 - 2024 — McMap. All rights reserved.