Click to Rate and Give Feedback
MSDN
MSDN Library
.NET Development
.NET Framework 3.5
<behaviors>
<serviceBehaviors>
<behavior>
 <serviceThrottling>

  Switch on low bandwidth view
This page is specific to
Microsoft Visual Studio 2008/.NET Framework 3.5

Other versions are also available for the following:
<serviceThrottling>

Specifies the throttling mechanism of a Windows Communication Foundation (WCF) service.

<system.serviceModel>
  <behaviors>
    <serviceBehaviors>
      <behavior> of <serviceBehaviors>
        <serviceThrottling>
<serviceThrottling maxConcurrentCalls="Integer"
    maxConcurrentInstances="Integer"
    maxConcurrentSessions="Integer" />

Attributes

Attribute Description

maxConcurrentCalls

A positive integer that limits the number of messages that currently process across a ServiceHost. 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.

maxConcurrentInstances

A positive integer that limits the number of InstanceContext objects that execute at one time across a ServiceHost. Requests to create additional instances are queued and complete when a slot below the limit becomes available. The default is Int32.MaxValue.

maxConcurrentSessions

A positive integer that limits the number of sessions a ServiceHost object can accept.

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.

Child Elements

None.

Parent Elements

Element Description

<behavior> of <endpointBehaviors>

Specifies a behavior element.

Throttling controls place limits on the number of concurrent calls, instances, or sessions to prevent over-consumption of resources.

A trace is written every time the value of attributes is reached. The first trace is written as a warning.

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>


© 2007 Microsoft Corporation. All rights reserved.

Tags What's this?: Add a tag
Community Content   What is Community Content?
Add new content RSS  Annotations
Throttling on by default for tcp bindings      Steve Campbell ... Thomas Lee   |   Edit   |   Show History
Even in the absence of a specified throttling behavior, throttling still exists for the TCP binding, using the default settings. Where you are most likely to encounter this is with the maxConcurrentSessions being 10. Effectively, this throttles incoming TCP connections on a particular port to 10. After 10, new connection requests will timeout.
maxConcurrentCalls with a value of 0      RWF ... Thomas Lee   |   Edit   |   Show History
0 is not a valid value when setting maxConcurrentCalls in the config file. When setting this value to 0 in the config, the service will failt to start.
Processing
© 2009 Microsoft Corporation. All rights reserved. Terms of Use  |  Trademarks  |  Privacy Statement
Page view tracker