Here you have several options, especially in that they are related to installing WCF and Concurrency.
Instancing: your choice here
- PerCall : for each client request, a new InstanceContext instance is created (and therefore a service object).
- PerSession : for each new client session, a new InstanceContext instance is created (and therefore a service object), which is maintained for the lifetime of this session (this requires a binding that supports sessions).
- Single . A single InstanceContext instance (and therefore a service object) processes all client requests for the lifetime of the application.
Concurrency:
- Single . Each instance context is allowed to have at most one message flow in the instance context at a time. Other topics that wish to use the same instance context should be blocked until the source thread exits the instance context.
- A few . Each service instance can process messages from multiple threads simultaneously. The service implementation must be thread safe to use this concurrency mode.
- Reentrant . Each service instance processes one message at a time, but receives calls to re-login operations. The service accepts these calls only when called through a WCF client object.
Let's first look at Instancing:
For the call . Basically what happens here is what happens if two clients make a call to your service, 2 different instances of your service are created and then destroyed when the call ends
Per session . If these two clients make 2 calls through your proxy server, then the wcf instance created on your host for both of these calls will be the same (for each proxy server, so there are 2 instances serving 2 each, except for each caller, goes to the same instance), and then destroyed
Single . Both proxies / clients will use the same instance, so caller 1 calls the operation and then caller 2 makes the call, the same instance will be reused.
Pretty straight forward.
As for concurrency, its number of threads is active in the above instance context at a time. Here I am a proponent of experience and MSDN, which states that "understanding and developing code that safely uses more than one thread can be difficult to write" ( but not impossible )
Thus, based on your requirements, it seems that you do not want to maintain state and scalability, it can be a problem, since you handle several proxy calls, and you do not need to transfer any global data that requires Single Instance mode, then the most the likely solution would be:
[ServiceBehavior (ConcurrencyMode.Single, InstanceContextMode=InstanceContextMode.PerCall)] public class YourService: IYourService { }