viniciushana
viniciushana

Reputation: 245

WCF Concurrency Issues

I have an MVC ASP.NET application that, inside the document.ready of a view, makes N calls to a specific action using $.ajax. This action, in turn, calls a method in a WCF service. This method accesses a queue of objects, dequeuing it, and it finally returns an object, and a property inside this object is returned by the calling action as JSON back to the $.ajax call, that handles it through the function specified in the 'success' parameter.

Problem is, it's not running concurrently, telling by the data log4net generates. Most of the time, the same thread handles all the WCF calls. And they are all sequential, judging by the start and end times. We don't get any errors, all the calls are executed successfully, but since they're not concurrent I have a performance problem.

Important: I have decorated the WCF service with InstanceContextMode = InstanceContextMode.Single, ConcurrencyMode = ConcurrencyMode.Multiple. The $.ajax call is async: true (the default value, I actually don't change it). The services are using netTcpBinding.

Any ideas?

Upvotes: 0

Views: 286

Answers (1)

Brad Christie
Brad Christie

Reputation: 101614

I know IE happens to limit two concurrent ajax calls to a single domain, not sure if it's a browser issue. Though a silverlight article, this link may be helpful.

Also, did you confirm what values are in the serviceBehavior, specifically maxConcurrentCalls?

Upvotes: 0

Related Questions