通道工厂最大连接池

6

我正在创建一个测试工具,用于对服务器进行压力测试。我创建了许多不同的线程,向服务器发送独立的请求。它似乎受到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
你是否已经配置了限流 - oleksii
我没有访问服务器配置的权限,但我确信服务器能够处理比测试工具当前发送的更多的调用,因此限制在测试工具上。我已经添加了测试工具的配置。 - kazvictor
1个回答

6

谢谢!我正试图做和你一模一样的事情,一度在考虑创建多个进程来解决这个问题。 - Mas

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接