Specifies the throttling mechanism of a Windows Communication Foundation (WCF) service.
<behavior> of <serviceBehaviors>
<serviceThrottling maxConcurrentCalls="Integer" maxConcurrentInstances="Integer" maxConcurrentSessions="Integer" />
The following sections describe attributes, child elements, and parent elements.
A positive integer that specifies the number of concurrent calls to a single service instance. Calls in excess of the limit are queued. Setting this value to 0 is equivalent to setting it to Int32.MaxValue. The default is 16.
A positive integer that specifies the maximum number of concurrent service instances. Requests to create additional instances are queued and complete when a slot below the limit becomes available. The default is Int32.MaxValue.
A positive integer that specifies the maximum number of concurrent connections to a single service. The service will accept connections in excess of the limit, but only the channels below the limit are active (messages are read from the channel). Setting this value to 0 is equivalent to setting it to Int32.MaxValue. The default is 10.
Specifies a behavior element.
The following configuration example specifies that the service limits the maximum concurrent calls to 2, and the maximum number of concurrent instances to 10. For a detailed example of running this example, see Throttling.
<behaviors> <serviceBehaviors> <behavior name="CalculatorServiceBehavior"> <serviceDebug includeExceptionDetailInFaults="False" /> <serviceMetadata httpGetEnabled="True"/> <!-- Specify throttling behavior --> <serviceThrottling maxConcurrentCalls="2" maxConcurrentInstances="10"/> </behavior> </serviceBehaviors> </behaviors>
© Microsoft Corporation. All rights reserved.