views:

117

answers:

2

Hi, I'm developing an Ajax-based application which makes heavy use of server calls to a WCF layer that communicates with a DB. Whenever I effect from the client (an ASP.NET page) many calls within a short span of time to the underlying WCF services, the system hangs and goes into a idle state.

How can I handle such concurrency problems? Thanks.

A: 

Without your configuration is hard to help, but

  • are clients disposed/chanell closed correctly after calls?
  • is your service per call, singleton or per session?
  • have you tried Fiddler or other trace tool to catch your http traffic?
boj
A: 

Well, assuming that the problem isn't DB concurrency, or web server hardware related, here's something to try... WCF has some throttling defaults that caused a similar problem with one of my apps. The defaults were VERY low (something like 20 concurrent calls/sessions/instances) Add the following to your config:

<!--add a behavior to modify the throttling -->

<behaviors>
 <serviceBehaviors>
 <behavior name="LessThrottlingBehavior">
 <serviceThrottling 
        maxConcurrentCalls="100" 
        maxConcurrentSessions="100" 
        maxConcurrentInstances="100"
      />

    </behavior>
  </serviceBehaviors>
</behaviors>

<!-- modify the service to point to this behavior -->

 <services>
<service name="MyWCFServer.WCFServer" behaviorConfiguration="LessThrottlingBehavior">
</service>
</services>
XDecker