ConcurrencyMode? InstanceContextMode?

Topics: Web Api
Dec 8, 2011 at 9: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 9, 2011 at 11:38 PM

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

Daniel Roth

Dec 10, 2011 at 6: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).