views:

40

answers:

1

Hello all,

I have a duplex enabled service where clients register themselves to receive notifications. In the same AppPool I have another, regular web service which is used by the clients to communicate with the server. Sending something to this web service will trigger a notification to all connected clients. All works fine until 12, 13 or more clients are connected. Then both subscribing/receiving with the duplex channel and sending something to the other service becomes much slower. I have disabled asp.net compatibility and I don't have a global.asax file in my web service project that could trigger sessions to slow it down.

My web services are hosted in IIS7 on Windows Server 2008. Please note that my clients run SL4 but the Webservices are hosted in .NET 3.5.

Here a few excerpts from my web.config file:

<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> 

Thanks in advance.

A: 

we had the same issue time ago.

all things seems fine what you just described, except your configurations. you did not specify inactivity time out, open / closed time outs in your binding configuration for service. please set them accordingly. you can check the msdn for what works with you.

try only one instance at a time of service. but with multiple concurrency model. after load test we found it better approach in our case.

Load test of your duplex service, do check out performance counters during load test, to see whats going on on your server, is the RAM/ processor having trouble. Is the IIS worker process being halted? Please do check out these things.

you can Google about performance counter.

Enable WCF Tracing!!! May be there are some problems inside which are not being pop out.

Implement your custom tracing in your application to see whats going on. (optional but was very helpful in our case.)

Revist your architecture/ design of your Duplex service.

read the guidelines of WCF duplex service Performance guidelines on msdn. (very helpful)

Make your service multi threaded model enabled if you are setting the concurrency mode = multi and instance = 1.

Regards,

Mazhar Karimi

Mazhar Karimi