WCF gives the developer the tools to provide high performance for your WCF Service,once of the key features to provide high performance WCF Service caled “Service Throttling”;this concept simply provide you the values you want to set to manage the following:
1) Maximum Concurrent sessions.
2) Maximum Concurrent Calls.
3) Maximum Concurrent Instances.
These values should be set on the host app of the service,and the admin has to monitor the server which host WCF Services to monitor the perfomance of the running WCF services.
To Implement Service throttling on your service,you have to write this code before open the serviceHost Object :
// Required for the ServiceThrottlingBehavior class
ServiceHost host = new ServiceHost(…);
ServiceThrottlingBehavior throttleBehavior = new ServiceThrottlingBehavior();
throttleBehavior.MaxConcurrentCalls = 40;
throttleBehavior.MaxConcurrentInstances = 20;
throttleBehavior.MaxConcurrentSessions = 20;
Note : that we set these values before open the servicehost object.
Take care of the following Tips :
1) Default Concurrent Instances is Int32.Max = 21474836467
2) Default Concurrent Calls is 16
3) Default Concurrent Calls is 10
Hope this helps for WCF developers 🙂