我正在创建一个测试工具,用于对服务器进行压力测试。我创建了许多不同的线程,向服务器发送独立的请求。它似乎受到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>