Skip to main content

WCF throttling (Resource Utilization/ Load Balance) configuration

WCF throttling (Resource Utilization/ Load Balance) :
Limit how many instances or sessions are created at the application level for better utilization of resource and memory.

Resource Utilization : With the implementation of throttling, we can properly utilize the available resource like Memory, threads. Each resource could be managed at its reasonable limit to avoid very high utilization of any specific resource.

Load Balance :  Application should work under  balanced load. If we execute anything concurrently then there could lot of performance and load balancing related problem will occur.

WCF throttling allow us to manage our resource utilization and balancing the load as per our processor/RAM availability.
We have  following three property which allow us to control WCF service behavior:
      WCF throttling                  -WCF behavior setting  config level
a.       maxConcurrentCalls  - number of messages that currently process across a ServiceHost (Default: (depends on Framework version) * processor count)
b.      maxConcurrentSessions - number of sessions a ServiceHost object can accept, only the channels below the limit are active   (Default: 16 * processor count)
c.       maxConcurrentInstances - number of InstanceContext objects that execute at one time across a ServiceHost (Default: maxConcurrentSessions +  MaxConcurrentCalls)

·    MaxConcurrentSessions (default: 10)
·    MaxConcurrentCalls (default: 16)
·    MaxConcurrentInstances (default: 26)

Default setting for WCF 4.O for scalability according to the Web Server:
MaxConcurrentSessions: default is 100 * ProcessorCount
MaxConcurrentCalls: default is 16 * ProcessorCount
MaxConcurrentInstances: default is the total of the above two, which follows the same pattern as before. (Default: maxConcurrentSessions +  MaxConcurrentCalls)

This setting can be defined at config  file @ service Behaviors level
<serviceBehaviors>
        <behavior  name="Throttled">
          <serviceThrottling
            maxConcurrentCalls="1"
            maxConcurrentSessions="1"
            maxConcurrentInstances="1"
          />
          <serviceMetadata
            httpGetEnabled="true"
            httpGetUrl=""
          />
        </behavior>
      </serviceBehaviors>

Comments

Popular posts from this blog

WCF MaxReceivedMessageSize max value in .config

MaxReceivedMessageSize parameter in binding config   file:   For max file size in WCF, we need to set following parameter in binding files. <binding name="MyService"        maxReceivedMessageSize="2147483647"        maxBufferSize="2147483647" transferMode="Streamed" >        <readerQuotas maxDepth="2147483647" maxStringContentLength="2147483647"      maxArrayLength="2147483647" maxBytesPerRead="2147483647" maxNameTableCharCount="2147483647"/> <!-- other binding info here, such as security --> </binding> Max possible size: MaxReceivedMessageSize to 2147483647 (i.e. Int32.MaxValue), which is 2GB For our case, as we are using WsHttpBinding. <wsHttpBinding>         <binding name="wsHttpBindingSettings" maxReceivedMessageSize="2147483647">      ...

Deploying Custom Pipeline Component on BizTalk Server (PROD)

Deploying Custom Pipeline Component on BizTalk Server: ·         Deploying BizTalk Custom Pipeline Component   on BizTalk Server 2006 or Older Version : To deploy the custom Pipeline component on BizTalk server 2006 or older version. We need to add the Custom Pipeline component in GAC as well as “ C:\Program Files (x86)\Microsoft BizTalk Server 2006\Pipeline Components ” folder.   At design time it will access the Pipeline component dll located in “….. Microsoft   BizTalk Server 2006\Pipeline Components ” folder and show the component in pipeline toolbox. At runtime the BizTalk will use the Custom Pipeline component from GAC. ·         Deploying BizTalk Custom Pipeline Component   on BizTalk Server 2006 R2 or New Version : To deploy the custom Pipeline component on BizTalk server 2006 R2 or later version. We need to add the Custom Pipeline component only in “C:\Pr...

biztalk schema remove ns0 prefix

We can remove ns0 prefix simply by set the schema elements property or both elements and attributes properties to be qualified. To do that follow my steps: 1-       Open your schema 2-       Right Click <Schema> and select properties 3-       Use schema property editior and Set [Element FromDefult] to Unqualified , and then set [Attribute FromDefault] to Unqualified if you are using attributes in your schema. After applying the steps above, both XML instances below will be valid: Instance 1 (with ns0) < ns0:Root xmlns:ns0 = " http://RandomBizTalkProject.Schema1 " >   < Field1 > Field1_0 </ Field1 >   < Field2 > Field2_0 </ Field2 > </ ns0:Root > Instance 2 (without ns0) < Root xmlns = " http://RandomBizTalkProject.Schema1 " >   < Field1 > Field1_0 </ Field1 >   < Field2 >...