Here's the background info. I have a WCF service configured like so
[ServiceBehavior(InstanceContextMode = InstanceContextMode.PerCall)]
Now I need some help understanding exactly how this context mode works.
Here's the problem I'm dealing with. For the sake of argument, lets say I have a call that takes 10 seconds to execute and return from the server. If I make two calls simultaneously (using Ajax request), the first request will come back after 10 seconds. But the second request will come back after 20 seconds.
I was expecting that this context mode would process both requests independent of each other, and return both at the same time. Have I configured my service properly?
In
PerCalleach call is assigned a separate instance (for extreme scalability). Every call to the method results in a new server object being created (separate thread). Once the request has been processed (method returns), the new instance is released.If you had configured the method to use
ConcurrencyMode.Singlethen you would see this blocking behavior.You should consider reviewing the
serviceThrottlingconfiguration to ensure that your application is tuned properly.