Instance Throttling
In order to increase throughput at the service, multiple concurrent calls must be
allowed to process. PerCall
services are capable of
multiple concurrent calls by default since each call is allocated its own service instance.
PerSession
services also allow throughput from unique
clients, but allow only requests from the same client session one at a time. Single
instancing mode allows only one request to be processed
at a time by default, regardless of the client, which can impact throughput. To increase
throughput for multithreaded sessions and singleton services, you can set the concurrency
mode to Multiple
and provide more granular
synchronization mechanisms, as discussed in the previous section.
Regardless of the concurrency mode, server resources are not generally capable of servicing an unlimited number of concurrent requests. Each request may require a certain amount of processing, memory allocation, hard disk and network access, and other overhead. Sessions also require the allocation of resources that usually outlive an individual request, as do singletons. WCF provides a throttling behavior to manage server load and resource consumption with the following properties:
MaxConcurrentCalls
Limits the number of concurrent requests that can be processed by all service instances. The default value is 16.
MaxConcurrentInstances
Limits the number of service instances that can be allocated at a given time. For
PerCall
services, this setting matches the number of concurrent ...
Get Learning WCF now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.