2010-09-28 39 views
0

我有一个启用了双工的服务,其中客户端注册自己以接收通知。 在同一个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> 

在此先感谢。

回答

0

我们在同一个问题前的时间。

所有的事情看起来都很好,你刚刚描述的除了你的配置。您没有指定不活动超时,在服务的绑定配置中打开/关闭超时。请相应地设置它们。你可以检查MSDN的什么与你合作。

在服务时间只尝试一个实例。但具有多个并发模型。经过负载测试后,我们发现它在我们的情况下更好。

负载测试您的双工服务,请检查负载测试期间的性能计数器,看看你的服务器上发生了什么,有RAM /处理器有问题。 IIS工作进程是否被暂停?请检查这些东西。

你可以谷歌关于性能计数器。

启用WCF跟踪!可能会出现一些内部不会弹出的问题。

在您的应用程序中实现您的自定义跟踪,以查看发生了什么。 (可选,但对我们的情况非常有帮助。)

修复您的Duplex服务的架构/设计。

阅读WCF双工服务指南关于msdn的性能指南。 (非常有用)

让您启用服务的多线程模式,如果你设定的并发模式=多和实例= 1

问候,

了Mazhar卡里米

+0

你可以添加一个linkg为MSDN上的“WCF双工服务性能指南”? – sll 2012-12-26 11:03:38

相关问题