ServiceThrottle Class

 
System_CAPS_noteNote

The .NET API Reference documentation has a new home. Visit the .NET API Browser on docs.microsoft.com to see the new experience.

Controls the throughput of a service to optimize availability and performance.

Namespace:   System.ServiceModel.Dispatcher
Assembly:  System.ServiceModel (in System.ServiceModel.dll)

System.Object
  System.ServiceModel.Dispatcher.ServiceThrottle

public sealed class ServiceThrottle

NameDescription
System_CAPS_pubpropertyMaxConcurrentCalls

Gets or sets the maximum number of messages actively processing across all dispatcher objects in a ServiceHost.

System_CAPS_pubpropertyMaxConcurrentInstances

Gets or sets the maximum number of service objects that can execute at one time.

System_CAPS_pubpropertyMaxConcurrentSessions

Gets or sets a value that specifies the maximum number of sessions a ServiceHost object can accept at one time.

NameDescription
System_CAPS_pubmethodEquals(Object)

Determines whether the specified object is equal to the current object.(Inherited from Object.)

System_CAPS_pubmethodGetHashCode()

Serves as the default hash function. (Inherited from Object.)

System_CAPS_pubmethodGetType()

Gets the Type of the current instance.(Inherited from Object.)

System_CAPS_pubmethodToString()

Returns a string that represents the current object.(Inherited from Object.)

Use the ServiceThrottle to tune the performance characteristics of a service. The easiest way to configure the ServiceThrottle for a service is to use the ServiceThrottlingBehavior, especially from an application configuration file.

The MaxConcurrentCalls property specifies the maximum number of messages actively processing across all the dispatcher objects in a ServiceHost object.

The MaxConcurrentInstances property specifies the maximum number of InstanceContext objects in the service.

The MaxConcurrentSessions property specifies the maximum number of sessions a ServiceHost can accept.

System_CAPS_noteNote

A trace is written when the first call, InstanceContext, or session is queued on the waitlist. The first trace is written as a warning.

The following code example shows the typical use of the ServiceThrottle by referencing the ServiceThrottlingBehavior in an application configuration file. In this case, the values that are specified establish, at most, one message processing at one time from one connection to one InstanceContext. Real-world usage must be determined through experience.

.NET Framework
Available since 3.0

Any public static ( Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

Return to top
Show: