ConcurrencyMode? InstanceContextMode?

Topics: Web Api
Dec 8, 2011 at 10:39 PM


I wanted to know if these options (ConcurrencyMode? InstanceContextMode?) are available for WebAPI, and if so, what are their defaults?

I would like to know whether the service I wrote is currently restricting itself to one concurrent call or not.



Dec 10, 2011 at 12:38 AM

We don’t do anything special here - we just use the WCF defaults:

Daniel Roth

Dec 10, 2011 at 7:17 AM

Hi Daniel,

From what I can tell, the defaults appear to be:

ConcurrencyMode.Single (
InstanceContextMode.PerSession (
SessionMode.Allowed (I think?

This would seem to mean by default concurrent requests from the same client (as defined by a .Net session cookie) are not allowed.

Handling multiple clients concurrently though seems to be allowed?

I may have to run some tests on my service, as I cannot tell whether performance improves that much when I explicitly set ConcurrencyMode.Multiple and InstanceContextPerMode.PerCall, which would make the service entirely stateless as intended (and provide the best concurrency).