Tuesday 13 December 2016

What is WCF throttling?

WCF throttling provides some properties that you can use to limit how many instances or sessions are created at the application level. Performance of the WCF service can be improved by creating proper instance.

The throttling of services is another key element for WCF performance tuning. WCF throttling provides the prosperities maxConcurrentCalls, maxConcurrentInstances, and maxConcurrentSessions, that can help us to limit the number of instances or sessions are created at the application level.
Attribute / PropertyDescription
maxConcurrentCallsThis specifies the maximum number of messages processed across the service host. The default value for this property is 16 (WCF 4.0 is improved to default is 16 * Processor Count).
maxConcurrentInstancesThis specifies the maximum number of instances of a context object that executes at one time with the service. The default is Int32.MaxValue.
maxConcurrentSessionsThis specifies the maximum number of sessions at one time within the service host object. The default value is 10 (WCF 4.0 increases that to 100 * Processor Count).
  1. <configuration>  
  2.     <system.serviceModel>  
  3.         <services>  
  4.             <service .... .... .... </service>  
  5.         </services>  
  6.         <behaviors>  
  7.             <serviceBehaviors>  
  8.                 <behavior name="ServiceBehavior">  
  9.                     <serviceThrottling maxConcurrentCalls="16" maxConcurrentSessions="100" maxConcurrentInstances="10" />  
  10.                     <serviceMetadata httpGetEnabled="true" /> </behavior>  
  11.             </serviceBehaviors>  
  12.         </behaviors>  
  13.     </system.serviceModel>  
  14. </configuration>  

No comments:

Post a Comment