Using throttling to control service concurrency
There are many facts in WCF which can impact the concurrency performance of a service. For example, the maximum number of instances that can be activated concurrently, the maximum number of sessions that can be active concurrently, and the maximum number of service operation calls that can be executed simultaneously. If configured incorrectly or in a bad manner, it is possible that our service might encounter a performance bottleneck or suffer a DOS attack in an unpredictable internet environment.
Fortunately, WCF also provides sufficient built-in configuration options for developers to control these concurrency-specific behaviors of the running service. This recipe will introduce the Throttling settings that WCF uses to achieve the task.
How to do it...
To control all those concurrency factors, we need to apply ServiceThrottlingBehavior
on our target service on which we want to control the concurrency behaviors. ServiceThrottlingBehavior
provides...