共用方式為


WCF Beta 2 Docs for ServiceThrottlingBehavior

The earlier sample code came from the following thread (https://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=145893&SiteID=1), on which David L1 also noted some characteristics of the various properties. What follows is the documentation for those properties that I'll be putting into the topic this evening. I just wanted to get the information out there to people who are interested right now.

The MaxConcurrentCalls property specifies the maximum number of messages actively processing across all the Dispatcher objects in a ServiceHost object. Each channel can have one pending message that does not count against the value of MaxConcurrentCalls until WCF begins to process it.

Note: The MaxConcurrentCalls value is ignored if the value of the System.ServiceModel.ServiceBehaviorAttribute.ConcurrencyMode is ConcurrencyMode.Single.

The MaxInstances property specifies the maximum number of InstanceContext objects in the service. It is important to keep in mind the relationship between the MaxInstances property and the System.ServiceModel.ServiceBehaviorAttribute.InstanceContextMode property. If System.ServiceModel.ServiceBehaviorAttribute.InstanceContextMode is InstanceContextMode.PerSession or InstanceContextMode.Shareable, the resulting value is the total number of sessions. If System.ServiceModel.ServiceBehaviorAttribute.InstanceContextMode is InstanceContextMode.PerCall, the resulting value is the number of concurrent calls. If a message arrives while the maximum number of InstanceContext objects already exist, the message is held until an InstanceContext object closes.

The MaxConnections property specifies the maximum number of channels a ServiceHost can accept. Each listener object can have one pending channel that does not count against the value of MaxConnections until WCF accepts the channel and begins processing messages on it. This property is most useful in scenarios that make use of sessions.

The MaxPendingOperations property is deprecated.

Comments