我有一个启用了双工的服务,其中客户端注册自己以接收通知。 在同一个AppPool中,我有另一个常用的Web服务,客户端使用它来与服务器进行通信。发送一些东西到这个Web服务将触发一个通知给所有连接的客户端。 所有工作正常,直到12,13或更多客户连接。然后,使用双工信道订阅/接收和向其他服务发送内容变得更慢。 我禁用了asp.net兼容性,并且我的web服务项目中没有global.asax文件,可能会触发会话以减慢速度。当多个客户端使用轮询双工绑定连接时,Webservice(s)变得无响应
我的Web服务托管在Windows Server 2008上的IIS7中。 请注意,我的客户端运行SL4,但Web服务托管在.NET 3.5中。
以下几个从我的web.config文件的摘录:
<bindingExtensions>
<add name="pollingDuplexHttpBinding" type="System.ServiceModel.Configuration.PollingDuplexHttpBindingCollectionElement,System.ServiceModel.PollingDuplex, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" /> </bindingExtensions>
<pollingDuplexHttpBinding>
<binding name="pollingDuplexHttpBindingConfig"/>
</pollingDuplexHttpBinding>
<service name="WcfDuplexService.NotificationService"
behaviorConfiguration="ServiceBehavior">
<!-- Service Endpoints -->
<endpoint address=""
binding="pollingDuplexHttpBinding"
bindingConfiguration="pollingDuplexHttpBindingConfig"
contract="WcfDuplexService.INotificationService"
behaviorConfiguration="ServiceFullEndpointBehavior">
</endpoint>
<endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange"/>
</service>
<!-- Message Service -->
<service name="WcfDuplexService.MessageService"
behaviorConfiguration="ServiceBehavior">
<endpoint binding="customBinding"
bindingNamespace="http://csintra.net/MessageService"
contract="WcfDuplexService.IMessageService"
bindingConfiguration="binaryHttpBinding"
behaviorConfiguration="ServiceFullEndpointBehavior">
<identity>
<dns value="localhost" />
</identity>
</endpoint>
<endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange" />
</service>
<serviceBehaviors>
<behavior name="ServiceBehavior">
<serviceThrottling maxConcurrentCalls="1024" maxConcurrentSessions="1024" maxConcurrentInstances="1024" />
<!-- To avoid disclosing metadata information, set the value below to false and remove the metadata endpoint above before deployment -->
<serviceMetadata httpGetEnabled="true"/>
<!-- To receive exception details in faults for debugging purposes, set the value below to true. Set to false before deployment to avoid disclosing exception information -->
<serviceDebug includeExceptionDetailInFaults="true"/>
</behavior>
</serviceBehaviors>
在此先感谢。
你可以添加一个linkg为MSDN上的“WCF双工服务性能指南”? – sll 2012-12-26 11:03:38