Quantcast
Channel: BizTalk: Configuring Throttling to slow down message processing
Viewing all 36 articles
Browse latest View live

How To Make BizTalk Process Messages Slowly

$
0
0
Revision 20 posted to TechNet Articles by [Kamlesh Kumar] on 9/18/2016 11:38:07 AM

Problem

Normally you want messages in BizTalk to be processed as fast as possible. However, this is not always the case, especially when BizTalk delivers messages faster than the receiving system can handle. I have seen this behaviour with systems like IBM ContentManager, which crashes hard when BizTalk pounds it with thousands of messages in short periods. Sometimes you actually like BizTalk to slow down, and process messages at a more moderate pace. So what do you do? Develop a custom library in C# to control the load?No!

Solution

BizTalk hosts have a wide variety of configuration options, and can be tuned for specific scenarios like low latency. The built-in throttling functionality will kick in when BizTalk cannot handle the load, but this behavior can also be forced. By changing the Resource-Based Throttling and Rate-Based Throttling settings, we can force a host to process messages slowly.

The rest of this article will discuss this configuration file in the TechNet Gallery (SlowlyRunningHost.xml).

Details

The XML configuration file contains several settings, which change the default behaviour of a BizTalk host. The host name in this case isSlowlyRunningHost, and the following details and tests are performed on a standard BizTalk VM running in Azure. An experienced BizTalk administrator should have no problem reproducing this test based on the descriptions and pictures. If you need assistance, view the How to reproduce this test section below, which explains everything step by step.

Figure 1. SlowlyRunningHost in BizTalk Administration Console

To make the host run slowly, we need to alter Resource-Based Throttling settings. To read and modify these settings, right-click yourBizTalk Group in the Administration Console, choose Settings... and thenHosts. Select the SlowlyRunningHost in the dropdown. The "i" icon to the right indicates the value has been changed. For a thorough explanation of all settings, read this article.

Resource-Based Throttling - Configuration Changes

  • Threads: Maximum number of messaging engine threads per CPU. Default value is0, meaning no threshold
  • In-process messages: Maximum number of in-memory in-flight messages allowed before throttling message delivery begins. Default value is1000
  • Internal message queue size: Size of the in-memory queue. This queue serves as a temporary placeholder for delivering messages. Default value is100
  • Message count in DB: Maximum number of items in the database. Default value is50000
  • Severity - Inflight message: Controls the reaction time of throttling when the in-process size exceeds the threshold. Default value is75%

Figure 2. Resource-Based Throttling

Next, we need to changeRate-Based Throttling settings for the host.

Rate-Based Throttling - Configuration Changes

  • Publishing
    • Minimum number of samples: The number of samples used to determine the rate of message publishing by the service classes of the host. Default value is100
    • Sampling window duration: Time-window beyond which samples will not be considered. Default value is15s
    • Rate overdrive factor: Percentage factor by which the system will overdrive the input rate. Default value is125%
    • Maximum throttling delay: The maximum delay imposed for message publishing throttling. Default value is300s
    • Throttling override: Can be used to override message publishing throttling. Default value isDo Not Override
  • Delivery
    • Minimum number of samples: The number of samples used to determine the rate of message delivery by the service classes of the host. Default value is100
    • Sampling window duration: Time-window beyond which samples will not be considered. Default value is15s
    • Rate overdrive factor: Percentage factor by which the system will overdrive the input rate. Default value is125%
    • Maximum throttling delay: The maximum delay imposed for message delivery throttling. Default value is300s
    • Throttling override: Can be used to override message delivery throttling. Default value isDo Not Override

Figure 3. Rate-Based Throttling

Configuration Settings XML-file

This is the exported XML configuration file which corresponds to the settings explained below. Note that settings not related to the SlowlyRunningHost host have been removed.

<?xmlversion="1.0"encoding="utf-8"?>
  <ExportedGroup>
  </ExportedGroup>
  <GroupSettings>
  </GroupSettings>
  <HostSettings>
    <HostName="SlowlyRunningHost">
      <SettingName="AllowMultipleResponses">False</Setting>
      <SettingName="AuthTrusted">False</Setting>
      <SettingName="DBQueueSizeThreshold">1000</Setting>
      <SettingName="DBSessionThreshold">0</Setting>
      <SettingName="DehydrationBehavior">2</Setting>
      <SettingName="DeliveryQueueSize">1000</Setting>
      <SettingName="GlobalMemoryThreshold">0</Setting>
      <SettingName="HostTracking">False</Setting>
      <SettingName="InflightMessageThreshold">3</Setting>
      <SettingName="IsHost32BitOnly">False</Setting>
      <SettingName="LegacyWhitespace">False</Setting>
      <SettingName="MessageDeliveryMaximumDelay">10000</Setting>
      <SettingName="MessageDeliveryOverdriveFactor">125</Setting>
      <SettingName="MessageDeliverySampleSpaceSize">1</Setting>
      <SettingName="MessageDeliverySampleSpaceWindow">3000</Setting>
      <SettingName="MessagePublishMaximumDelay">10000</Setting>
      <SettingName="MessagePublishOverdriveFactor">100</Setting>
      <SettingName="MessagePublishSampleSpaceSize">1</Setting>
      <SettingName="MessagePublishSampleSpaceWindow">30000</Setting>
      <SettingName="MessagingMaxReceiveInterval">500</Setting>
      <SettingName="MessagingReqRespTTL">20</Setting>
      <SettingName="MsgAgentPerfCounterServiceClassID">0</Setting>
      <SettingName="ProcessMemoryThreshold">25</Setting>
      <SettingName="SubscriptionPauseAt">0</Setting>
      <SettingName="SubscriptionResumeAt">0</Setting>
      <SettingName="ThreadPoolSize">20</Setting>
      <SettingName="ThreadThreshold">3</Setting>
      <SettingName="ThrottlingBatchMemoryThresholdPercent">1</Setting>
      <SettingName="ThrottlingDeliveryOverride">1</Setting>
      <SettingName="ThrottlingDeliveryOverrideSeverity">100</Setting>
      <SettingName="ThrottlingLimitToTriggerGC">80</Setting>
      <SettingName="ThrottlingPublishOverride">1</Setting>
      <SettingName="ThrottlingPublishOverrideSeverity">100</Setting>
      <SettingName="ThrottlingSeverityDatabaseSize">1</Setting>
      <SettingName="ThrottlingSeverityInflightMessage">10</Setting>
      <SettingName="ThrottlingSeverityProcessMemory">500</Setting>
      <SettingName="ThrottlingSpoolMultiplier">10</Setting>
      <SettingName="ThrottlingTrackingDataMultiplier">10</Setting>
      <SettingName="TimeBasedMaxThreshold">1800</Setting>
      <SettingName="TimeBasedMinThreshold">1</Setting>
      <SettingName="UseDefaultAppDomainForIsolatedAdapter">False</Setting>
      <SettingName="XlangMaxReceiveInterval">500</Setting>
    </Host>
  </HostSettings>
  <HostInstanceSettings>
  </HostInstanceSettings>
</Settings>

Important notes

  • This test uses one host for receiving and sending. In a production environment, you should implement a host separation strategy. Read more about this here
  • The values here may need tuning based on your needs and requirements. They may also cause different test results, which vary with different hardware and software configurations. Thorough testing is vital
  • Test results vary between the first and subsequent batch of messages after host instance restart

How to reproduce this test

  1. Create a BizTalk VM in Azure, or use a different test environment [How?]
    • BizTalk 2013 on Windows Server 2012
    • Use Standard A2 tier
  2. Create a host called SlowlyRunningHost [How?]
  3. Create a host instance using the host from step 2 [How?]
  4. Download the configuration file from the TechNet Gallery, and copy to your BizTalk server
  5. Backup the existing configuration [How?]
  6. Import the configuration file from step 4 [How?]
  7. Create Send and Receive handlers for the new host for the FILE adapter [How?]
  8. Create a new messaging application which moves all files from one folder to another. UseSlowlyRunningHost
  9. Optional: Reduce Batch Size to 1 [How?]
  10. Restart the host instance [How?]

Analysis

This section will illustrate how the host processes messages after implementing the tuning explained above. The application is moving 30 XML-files from one folder to another on the local C-drive of the server. The pipelines arePassThruReceive and PassThruTransmit. The file sizes vary between 11KB and 2336KB.

  • When using the standard BizTalkServerApplication host (with default settings), this process completes in a couple of seconds
  • When using the SlowlyRunningHost, this process completes in about 5 minutes

BizTalk Administration Console

During the test we can see that BizTalk is processing a small amount of messages at the same time, in this case 2. This is as expected.

Figure 4.All In-Progress Service Instances

Performance Monitor

Running Performance Monitor during the test gives us a lot of information. See screenshot below. Some key observations:

  • In-process message count is 2, and In-process message count threshold is 3, which corresponds to theIn-process messages count setting in BizTalk
  • Message delivery delay (ms) and Message publishing delay (ms) is 10000, which corresponds to theMaximum throttling delay setting in BizTalk
  • Message delivery throttling state is 10, and Message publishing throttling state is 11, which means custom/user override throttling
  • Thread count is 56, and Thread count threshold is 3, which incurs throttling and corresponds to the Threads setting in BizTalk

Figure 5. Performance Monitor during test

Performance Analysis of Logs (PAL)

Running PAL during tests provides a lot of details and graphical overview of important performance counters. A few of them will be used here as examples.

Message publishing throttling state: This is 11 during the whole test (over override on publishing)

Figure 6. Message publishing throttling state
Message delivery throttling state: This is 10 during the whole test (over override on delivery)

Figure 7. Message delivery throttling state

Message delivery delay (ms): This is 10000 (10 seconds) during the whole test.

Figure 8. Message delivery delay (ms)

Other Languages

This article is also available in the following languages

See Also

Suggested reading following resources:

Another important place to find an extensive amount of BizTalk related articles is the TechNet Wiki itself. The best entry point is BizTalk Server Resources on the TechNet Wiki.

Tags: BizTalk, XML, Administration, has code, BizTalk Server, throttling, has image, Has TOC, BizTalk Administration, en-US, has comment, has See Also, has Other Languages, multiple languages, has picture, magazine article, Kjetil Tonstad, slow down

BizTalk: Configuring Throttling to slow down message processing

$
0
0
Revision 21 posted to TechNet Articles by Peter Geelen on 9/18/2016 11:46:23 AM


Problem

Normally you want messages in BizTalk to be processed as fast as possible. However, this is not always the case, especially when BizTalk delivers messages faster than the receiving system can handle. I have seen this behaviour with systems like IBM ContentManager, which crashes hard when BizTalk pounds it with thousands of messages in short periods. Sometimes you actually like BizTalk to slow down, and process messages at a more moderate pace. So what do you do? Develop a custom library in C# to control the load?No!

Solution

BizTalk hosts have a wide variety of configuration options, and can be tuned for specific scenarios like low latency. The built-in throttling functionality will kick in when BizTalk cannot handle the load, but this behavior can also be forced. By changing the Resource-Based Throttling and Rate-Based Throttling settings, we can force a host to process messages slowly.

The rest of this article will discuss this configuration file in the TechNet Gallery (SlowlyRunningHost.xml).

Details

The XML configuration file contains several settings, which change the default behaviour of a BizTalk host. The host name in this case isSlowlyRunningHost, and the following details and tests are performed on a standard BizTalk VM running in Azure. An experienced BizTalk administrator should have no problem reproducing this test based on the descriptions and pictures. If you need assistance, view the How to reproduce this test section below, which explains everything step by step.

Figure 1. SlowlyRunningHost in BizTalk Administration Console

To make the host run slowly, we need to alter Resource-Based Throttling settings. To read and modify these settings, right-click yourBizTalk Group in the Administration Console, choose Settings... and thenHosts. Select the SlowlyRunningHost in the dropdown. The "i" icon to the right indicates the value has been changed. For a thorough explanation of all settings, read this article.

Resource-Based Throttling - Configuration Changes

  • Threads: Maximum number of messaging engine threads per CPU. Default value is0, meaning no threshold
  • In-process messages: Maximum number of in-memory in-flight messages allowed before throttling message delivery begins. Default value is1000
  • Internal message queue size: Size of the in-memory queue. This queue serves as a temporary placeholder for delivering messages. Default value is100
  • Message count in DB: Maximum number of items in the database. Default value is50000
  • Severity - Inflight message: Controls the reaction time of throttling when the in-process size exceeds the threshold. Default value is75%

Figure 2. Resource-Based Throttling

Next, we need to changeRate-Based Throttling settings for the host.

Rate-Based Throttling - Configuration Changes

  • Publishing
    • Minimum number of samples: The number of samples used to determine the rate of message publishing by the service classes of the host. Default value is100
    • Sampling window duration: Time-window beyond which samples will not be considered. Default value is15s
    • Rate overdrive factor: Percentage factor by which the system will overdrive the input rate. Default value is125%
    • Maximum throttling delay: The maximum delay imposed for message publishing throttling. Default value is300s
    • Throttling override: Can be used to override message publishing throttling. Default value isDo Not Override
  • Delivery
    • Minimum number of samples: The number of samples used to determine the rate of message delivery by the service classes of the host. Default value is100
    • Sampling window duration: Time-window beyond which samples will not be considered. Default value is15s
    • Rate overdrive factor: Percentage factor by which the system will overdrive the input rate. Default value is125%
    • Maximum throttling delay: The maximum delay imposed for message delivery throttling. Default value is300s
    • Throttling override: Can be used to override message delivery throttling. Default value isDo Not Override

Figure 3. Rate-Based Throttling

Configuration Settings XML-file

This is the exported XML configuration file which corresponds to the settings explained below. Note that settings not related to the SlowlyRunningHost host have been removed.

<?xmlversion="1.0"encoding="utf-8"?>
  <ExportedGroup>
  </ExportedGroup>
  <GroupSettings>
  </GroupSettings>
  <HostSettings>
    <HostName="SlowlyRunningHost">
      <SettingName="AllowMultipleResponses">False</Setting>
      <SettingName="AuthTrusted">False</Setting>
      <SettingName="DBQueueSizeThreshold">1000</Setting>
      <SettingName="DBSessionThreshold">0</Setting>
      <SettingName="DehydrationBehavior">2</Setting>
      <SettingName="DeliveryQueueSize">1000</Setting>
      <SettingName="GlobalMemoryThreshold">0</Setting>
      <SettingName="HostTracking">False</Setting>
      <SettingName="InflightMessageThreshold">3</Setting>
      <SettingName="IsHost32BitOnly">False</Setting>
      <SettingName="LegacyWhitespace">False</Setting>
      <SettingName="MessageDeliveryMaximumDelay">10000</Setting>
      <SettingName="MessageDeliveryOverdriveFactor">125</Setting>
      <SettingName="MessageDeliverySampleSpaceSize">1</Setting>
      <SettingName="MessageDeliverySampleSpaceWindow">3000</Setting>
      <SettingName="MessagePublishMaximumDelay">10000</Setting>
      <SettingName="MessagePublishOverdriveFactor">100</Setting>
      <SettingName="MessagePublishSampleSpaceSize">1</Setting>
      <SettingName="MessagePublishSampleSpaceWindow">30000</Setting>
      <SettingName="MessagingMaxReceiveInterval">500</Setting>
      <SettingName="MessagingReqRespTTL">20</Setting>
      <SettingName="MsgAgentPerfCounterServiceClassID">0</Setting>
      <SettingName="ProcessMemoryThreshold">25</Setting>
      <SettingName="SubscriptionPauseAt">0</Setting>
      <SettingName="SubscriptionResumeAt">0</Setting>
      <SettingName="ThreadPoolSize">20</Setting>
      <SettingName="ThreadThreshold">3</Setting>
      <SettingName="ThrottlingBatchMemoryThresholdPercent">1</Setting>
      <SettingName="ThrottlingDeliveryOverride">1</Setting>
      <SettingName="ThrottlingDeliveryOverrideSeverity">100</Setting>
      <SettingName="ThrottlingLimitToTriggerGC">80</Setting>
      <SettingName="ThrottlingPublishOverride">1</Setting>
      <SettingName="ThrottlingPublishOverrideSeverity">100</Setting>
      <SettingName="ThrottlingSeverityDatabaseSize">1</Setting>
      <SettingName="ThrottlingSeverityInflightMessage">10</Setting>
      <SettingName="ThrottlingSeverityProcessMemory">500</Setting>
      <SettingName="ThrottlingSpoolMultiplier">10</Setting>
      <SettingName="ThrottlingTrackingDataMultiplier">10</Setting>
      <SettingName="TimeBasedMaxThreshold">1800</Setting>
      <SettingName="TimeBasedMinThreshold">1</Setting>
      <SettingName="UseDefaultAppDomainForIsolatedAdapter">False</Setting>
      <SettingName="XlangMaxReceiveInterval">500</Setting>
    </Host>
  </HostSettings>
  <HostInstanceSettings>
  </HostInstanceSettings>
</Settings>

Important notes

  • This test uses one host for receiving and sending. In a production environment, you should implement a host separation strategy. Read more about this here
  • The values here may need tuning based on your needs and requirements. They may also cause different test results, which vary with different hardware and software configurations. Thorough testing is vital
  • Test results vary between the first and subsequent batch of messages after host instance restart

How to reproduce this test

  1. Create a BizTalk VM in Azure, or use a different test environment [How?]
    • BizTalk 2013 on Windows Server 2012
    • Use Standard A2 tier
  2. Create a host called SlowlyRunningHost [How?]
  3. Create a host instance using the host from step 2 [How?]
  4. Download the configuration file from the TechNet Gallery, and copy to your BizTalk server
  5. Backup the existing configuration [How?]
  6. Import the configuration file from step 4 [How?]
  7. Create Send and Receive handlers for the new host for the FILE adapter [How?]
  8. Create a new messaging application which moves all files from one folder to another. UseSlowlyRunningHost
  9. Optional: Reduce Batch Size to 1 [How?]
  10. Restart the host instance [How?]

Analysis

This section will illustrate how the host processes messages after implementing the tuning explained above. The application is moving 30 XML-files from one folder to another on the local C-drive of the server. The pipelines arePassThruReceive and PassThruTransmit. The file sizes vary between 11KB and 2336KB.

  • When using the standard BizTalkServerApplication host (with default settings), this process completes in a couple of seconds
  • When using the SlowlyRunningHost, this process completes in about 5 minutes

BizTalk Administration Console

During the test we can see that BizTalk is processing a small amount of messages at the same time, in this case 2. This is as expected.

Figure 4.All In-Progress Service Instances

Performance Monitor

Running Performance Monitor during the test gives us a lot of information. See screenshot below. Some key observations:

  • In-process message count is 2, and In-process message count threshold is 3, which corresponds to theIn-process messages count setting in BizTalk
  • Message delivery delay (ms) and Message publishing delay (ms) is 10000, which corresponds to theMaximum throttling delay setting in BizTalk
  • Message delivery throttling state is 10, and Message publishing throttling state is 11, which means custom/user override throttling
  • Thread count is 56, and Thread count threshold is 3, which incurs throttling and corresponds to the Threads setting in BizTalk

Figure 5. Performance Monitor during test

Performance Analysis of Logs (PAL)

Running PAL during tests provides a lot of details and graphical overview of important performance counters. A few of them will be used here as examples.

Message publishing throttling state: This is 11 during the whole test (over override on publishing)

Figure 6. Message publishing throttling state
Message delivery throttling state: This is 10 during the whole test (over override on delivery)

Figure 7. Message delivery throttling state

Message delivery delay (ms): This is 10000 (10 seconds) during the whole test.

Figure 8. Message delivery delay (ms)

Other Languages

This article is also available in the following languages

See Also

Suggested reading following resources:

Another important place to find an extensive amount of BizTalk related articles is the TechNet Wiki itself. The best entry point is BizTalk Server Resources on the TechNet Wiki.

Tags: BizTalk, XML, Administration, has code, BizTalk Server, throttling, has image, Has TOC, BizTalk Administration, en-US, has comment, has See Also, has Other Languages, multiple languages, has picture, magazine article, Kjetil Tonstad, slow down

BizTalk: Configuring Throttling to slow down message processing

$
0
0
Revision 22 posted to TechNet Articles by Pushpendra K Singh on 9/19/2016 2:27:58 PM


Problem

Normally you want messages in BizTalk to be processed as fast as possible. However, this is not always the case, especially when BizTalk delivers messages faster than the receiving system can handle. I have seen this behaviour with systems like IBM ContentManager, which crashes hard when BizTalk pounds it with thousands of messages in short periods. Sometimes you actually like BizTalk to slow down, and process messages at a more moderate pace. So what do you do? Develop a custom library in C# to control the load?No!

Solution

BizTalk hosts have a wide variety of configuration options, and can be tuned for specific scenarios like low latency. The built-in throttling functionality will kick in when BizTalk cannot handle the load, but this behavior can also be forced. By changing the Resource-Based Throttling and Rate-Based Throttling settings, we can force a host to process messages slowly.

The rest of this article will discuss this configuration file in the TechNet Gallery (SlowlyRunningHost.xml).

Details

The XML configuration file contains several settings, which change the default behaviour of a BizTalk host. The host name in this case isSlowlyRunningHost, and the following details and tests are performed on a standard BizTalk VM running in Azure. An experienced BizTalk administrator should have no problem reproducing this test based on the descriptions and pictures. If you need assistance, view the How to reproduce this test section below, which explains everything step by step.

Figure 1. SlowlyRunningHost in BizTalk Administration Console

To make the host run slowly, we need to alter Resource-Based Throttling settings. To read and modify these settings, right-click yourBizTalk Group in the Administration Console, choose Settings... and thenHosts. Select the SlowlyRunningHost in the dropdown. The "i" icon to the right indicates the value has been changed. For a thorough explanation of all settings, read this article.

Resource-Based Throttling - Configuration Changes

  • Threads: Maximum number of messaging engine threads per CPU. Default value is0, meaning no threshold
  • In-process messages: Maximum number of in-memory in-flight messages allowed before throttling message delivery begins. Default value is1000
  • Internal message queue size: Size of the in-memory queue. This queue serves as a temporary placeholder for delivering messages. Default value is100
  • Message count in DB: Maximum number of items in the database. Default value is50000
  • Severity - Inflight message: Controls the reaction time of throttling when the in-process size exceeds the threshold. Default value is75%

Figure 2. Resource-Based Throttling

Next, we need to changeRate-Based Throttling settings for the host.

Rate-Based Throttling - Configuration Changes

  • Publishing
    • Minimum number of samples: The number of samples used to determine the rate of message publishing by the service classes of the host. Default value is100
    • Sampling window duration: Time-window beyond which samples will not be considered. Default value is15s
    • Rate overdrive factor: Percentage factor by which the system will overdrive the input rate. Default value is125%
    • Maximum throttling delay: The maximum delay imposed for message publishing throttling. Default value is300s
    • Throttling override: Can be used to override message publishing throttling. Default value isDo Not Override
  • Delivery
    • Minimum number of samples: The number of samples used to determine the rate of message delivery by the service classes of the host. Default value is100
    • Sampling window duration: Time-window beyond which samples will not be considered. Default value is15s
    • Rate overdrive factor: Percentage factor by which the system will overdrive the input rate. Default value is125%
    • Maximum throttling delay: The maximum delay imposed for message delivery throttling. Default value is300s
    • Throttling override: Can be used to override message delivery throttling. Default value isDo Not Override

Figure 3. Rate-Based Throttling

Configuration Settings XML-file

This is the exported XML configuration file which corresponds to the settings explained below. Note that settings not related to the SlowlyRunningHost host have been removed.

<?xmlversion="1.0"encoding="utf-8"?>
  <ExportedGroup>
  </ExportedGroup>
  <GroupSettings>
  </GroupSettings>
  <HostSettings>
    <HostName="SlowlyRunningHost">
      <SettingName="AllowMultipleResponses">False</Setting>
      <SettingName="AuthTrusted">False</Setting>
      <SettingName="DBQueueSizeThreshold">1000</Setting>
      <SettingName="DBSessionThreshold">0</Setting>
      <SettingName="DehydrationBehavior">2</Setting>
      <SettingName="DeliveryQueueSize">1000</Setting>
      <SettingName="GlobalMemoryThreshold">0</Setting>
      <SettingName="HostTracking">False</Setting>
      <SettingName="InflightMessageThreshold">3</Setting>
      <SettingName="IsHost32BitOnly">False</Setting>
      <SettingName="LegacyWhitespace">False</Setting>
      <SettingName="MessageDeliveryMaximumDelay">10000</Setting>
      <SettingName="MessageDeliveryOverdriveFactor">125</Setting>
      <SettingName="MessageDeliverySampleSpaceSize">1</Setting>
      <SettingName="MessageDeliverySampleSpaceWindow">3000</Setting>
      <SettingName="MessagePublishMaximumDelay">10000</Setting>
      <SettingName="MessagePublishOverdriveFactor">100</Setting>
      <SettingName="MessagePublishSampleSpaceSize">1</Setting>
      <SettingName="MessagePublishSampleSpaceWindow">30000</Setting>
      <SettingName="MessagingMaxReceiveInterval">500</Setting>
      <SettingName="MessagingReqRespTTL">20</Setting>
      <SettingName="MsgAgentPerfCounterServiceClassID">0</Setting>
      <SettingName="ProcessMemoryThreshold">25</Setting>
      <SettingName="SubscriptionPauseAt">0</Setting>
      <SettingName="SubscriptionResumeAt">0</Setting>
      <SettingName="ThreadPoolSize">20</Setting>
      <SettingName="ThreadThreshold">3</Setting>
      <SettingName="ThrottlingBatchMemoryThresholdPercent">1</Setting>
      <SettingName="ThrottlingDeliveryOverride">1</Setting>
      <SettingName="ThrottlingDeliveryOverrideSeverity">100</Setting>
      <SettingName="ThrottlingLimitToTriggerGC">80</Setting>
      <SettingName="ThrottlingPublishOverride">1</Setting>
      <SettingName="ThrottlingPublishOverrideSeverity">100</Setting>
      <SettingName="ThrottlingSeverityDatabaseSize">1</Setting>
      <SettingName="ThrottlingSeverityInflightMessage">10</Setting>
      <SettingName="ThrottlingSeverityProcessMemory">500</Setting>
      <SettingName="ThrottlingSpoolMultiplier">10</Setting>
      <SettingName="ThrottlingTrackingDataMultiplier">10</Setting>
      <SettingName="TimeBasedMaxThreshold">1800</Setting>
      <SettingName="TimeBasedMinThreshold">1</Setting>
      <SettingName="UseDefaultAppDomainForIsolatedAdapter">False</Setting>
      <SettingName="XlangMaxReceiveInterval">500</Setting>
    </Host>
  </HostSettings>
  <HostInstanceSettings>
  </HostInstanceSettings>
</Settings>

Important notes

  • This test uses one host for receiving and sending. In a production environment, you should implement a host separation strategy. Read more about this here
  • The values here may need tuning based on your needs and requirements. They may also cause different test results, which vary with different hardware and software configurations. Thorough testing is vital
  • Test results vary between the first and subsequent batch of messages after host instance restart

How to reproduce this test

  1. Create a BizTalk VM in Azure, or use a different test environment [How?]
    • BizTalk 2013 on Windows Server 2012
    • Use Standard A2 tier
  2. Create a host called SlowlyRunningHost [How?]
  3. Create a host instance using the host from step 2 [How?]
  4. Download the configuration file from the TechNet Gallery, and copy to your BizTalk server
  5. Backup the existing configuration [How?]
  6. Import the configuration file from step 4 [How?]
  7. Create Send and Receive handlers for the new host for the FILE adapter [How?]
  8. Create a new messaging application which moves all files from one folder to another. UseSlowlyRunningHost
  9. Optional: Reduce Batch Size to 1 [How?]
  10. Restart the host instance [How?]

Analysis

This section will illustrate how the host processes messages after implementing the tuning explained above. The application is moving 30 XML-files from one folder to another on the local C-drive of the server. The pipelines arePassThruReceive and PassThruTransmit. The file sizes vary between 11KB and 2336KB.

  • When using the standard BizTalkServerApplication host (with default settings), this process completes in a couple of seconds
  • When using the SlowlyRunningHost, this process completes in about 5 minutes

BizTalk Administration Console

During the test we can see that BizTalk is processing a small amount of messages at the same time, in this case 2. This is as expected.

Figure 4.All In-Progress Service Instances

Performance Monitor

Running Performance Monitor during the test gives us a lot of information. See screenshot below. Some key observations:

  • In-process message count is 2, and In-process message count threshold is 3, which corresponds to theIn-process messages count setting in BizTalk
  • Message delivery delay (ms) and Message publishing delay (ms) is 10000, which corresponds to theMaximum throttling delay setting in BizTalk
  • Message delivery throttling state is 10, and Message publishing throttling state is 11, which means custom/user override throttling
  • Thread count is 56, and Thread count threshold is 3, which incurs throttling and corresponds to the Threads setting in BizTalk

Figure 5. Performance Monitor during test

Performance Analysis of Logs (PAL)

Running PAL during tests provides a lot of details and graphical overview of important performance counters. A few of them will be used here as examples.

Message publishing throttling state: This is 11 during the whole test (over override on publishing)

Figure 6. Message publishing throttling state
Message delivery throttling state: This is 10 during the whole test (over override on delivery)

Figure 7. Message delivery throttling state

Message delivery delay (ms): This is 10000 (10 seconds) during the whole test.

Figure 8. Message delivery delay (ms)

Other Languages

This article is also available in the following languages

See Also

Suggested reading following resources:

Another important place to find an extensive amount of BizTalk related articles is the TechNet Wiki itself. The best entry point is BizTalk Server Resources on the TechNet Wiki.

Tags: BizTalk, XML, Administration, has code, BizTalk Server, throttling, has image, Has TOC, BizTalk Administration, en-US, has comment, has See Also, has Other Languages, multiple languages, has picture, magazine article, Kjetil Tonstad, slow down, host throttling

How To Make BizTalk Process Messages Slowly

$
0
0
Revision 3 posted to TechNet Articles by Kjetil Tonstad on 7/23/2015 2:53:34 AM


Problem

Normally you want messages in BizTalk to be processed as fast as possible. This is not always the case, especially when BizTalk will deliver messages faster than the receiving system can handle them. I have seen this with systems like IBM ContentManager, which crashes hard when BizTalk pounds it with thousands of messages in short periods. Sometimes you actually want BizTalk to slow down, and process messages at a gentle pace. So what do you do? Develop a custom library in C# to control the load?No!

Solution

BizTalk hosts have a wide variety of configuration options, and can be tuned for specific scenarios like low latency. The built-in throttling functionality will kick in when BizTalk cannot handle the load, but this behavior can also be forced. By changing theResource-Based Throttling and Rate-Based Throttling settings, we can force a host to process messages slowly.

The rest of this article will discuss this configuration file in the TechNet Gallery (SlowlyRunningHost.xml).

Details

The XML configuration file contains several settings, which change the default behaviour of a BizTalk host. The host name in this case isSlowlyRunningHost, and the following details and tests are performed on a standard BizTalk VM running in Azure. An experienced BizTalk administrator should have no problem reproducing this test based on the descriptions and pictures. If you need assistance, view the How to reproduce this test section below, which explains everything step by step.


Figure 1: SlowlyRunningHost in BizTalk Administration Console

To make the host run slowly, we need to alter Resource-Based Throttling settings. To read and modify these settings, right-click yourBizTalk Group in the Administration Console, choose Settings... and thenHosts. Select the SlowlyRunningHost in the dropdown. The "i" icon to the right indicates the value has been changed. For a thorough explanation of all settings, read this article.

Resource-Based Throttling - Configuration Changes

  • Threads: Maximum number of messaging engine threads per CPU. Default value is0, meaning no threshold
  • In-process messages: Maximum number of in-memory in-flight messages allowed before throttling message delivery begins. Default value is1000
  • Internal message queue size: Size of the in-memory queue. This queue serves as a temporary placeholder for delivering messages. Default value is100
  • Message count in DB: Maximum number of items in the database. Default value is50000
  • Severity - Inflight message: Controls the reaction time of throttling when the in-process size exceeds the threshold. Default value is75%


Figure 2: Resouce-Based Throttling

Next, we need to change Rate-Based Throttling settings for the host.

Rate-Based Throttling - Configuration Changes

  • Publishing
    • Minimum number of samples: The number of samples used to determine the rate of message publishing by the service classes of the host. Default value is100
    • Sampling window duration: Time-window beyond which samples will not be considered. Default value is15s
    • Rate overdrive factor: Percentage factor by which the system will overdrive the input rate. Default value is125%
    • Maximum throttling delay: The maximum delay imposed for message publishing throttling. Default value is300s
    • Throttling override: Can be used to override message publishing throttling. Default value isDo Not Override
  • Delivery
    • Minimum number of samples: The number of samples used to determine the rate of message delivery by the service classes of the host. Default value is100
    • Sampling window duration: Time-window beyond which samples will not be considered. Default value is15s
    • Rate overdrive factor: Percentage factor by which the system will overdrive the input rate. Default value is125%
    • Maximum throttling delay: The maximum delay imposed for message delivery throttling. Default value is300s
    • Throttling override: Can be used to override message delivery throttling. Default value isDo Not Override


Figure 3: Rate-Based Throttling

Configuration Settings XML-file

This is the exported XML configuration file which corresponds to the settings explained below. Note that settings not related to the SlowlyRunningHost host have been removed.

<?xmlversion="1.0"encoding="utf-8"?>
  <ExportedGroup>
  </ExportedGroup>
  <GroupSettings>
  </GroupSettings>
  <HostSettings>
    <HostName="SlowlyRunningHost">
      <SettingName="AllowMultipleResponses">False</Setting>
      <SettingName="AuthTrusted">False</Setting>
      <SettingName="DBQueueSizeThreshold">1000</Setting>
      <SettingName="DBSessionThreshold">0</Setting>
      <SettingName="DehydrationBehavior">2</Setting>
      <SettingName="DeliveryQueueSize">1000</Setting>
      <SettingName="GlobalMemoryThreshold">0</Setting>
      <SettingName="HostTracking">False</Setting>
      <SettingName="InflightMessageThreshold">3</Setting>
      <SettingName="IsHost32BitOnly">False</Setting>
      <SettingName="LegacyWhitespace">False</Setting>
      <SettingName="MessageDeliveryMaximumDelay">10000</Setting>
      <SettingName="MessageDeliveryOverdriveFactor">125</Setting>
      <SettingName="MessageDeliverySampleSpaceSize">1</Setting>
      <SettingName="MessageDeliverySampleSpaceWindow">3000</Setting>
      <SettingName="MessagePublishMaximumDelay">10000</Setting>
      <SettingName="MessagePublishOverdriveFactor">100</Setting>
      <SettingName="MessagePublishSampleSpaceSize">1</Setting>
      <SettingName="MessagePublishSampleSpaceWindow">30000</Setting>
      <SettingName="MessagingMaxReceiveInterval">500</Setting>
      <SettingName="MessagingReqRespTTL">20</Setting>
      <SettingName="MsgAgentPerfCounterServiceClassID">0</Setting>
      <SettingName="ProcessMemoryThreshold">25</Setting>
      <SettingName="SubscriptionPauseAt">0</Setting>
      <SettingName="SubscriptionResumeAt">0</Setting>
      <SettingName="ThreadPoolSize">20</Setting>
      <SettingName="ThreadThreshold">3</Setting>
      <SettingName="ThrottlingBatchMemoryThresholdPercent">1</Setting>
      <SettingName="ThrottlingDeliveryOverride">1</Setting>
      <SettingName="ThrottlingDeliveryOverrideSeverity">100</Setting>
      <SettingName="ThrottlingLimitToTriggerGC">80</Setting>
      <SettingName="ThrottlingPublishOverride">1</Setting>
      <SettingName="ThrottlingPublishOverrideSeverity">100</Setting>
      <SettingName="ThrottlingSeverityDatabaseSize">1</Setting>
      <SettingName="ThrottlingSeverityInflightMessage">10</Setting>
      <SettingName="ThrottlingSeverityProcessMemory">500</Setting>
      <SettingName="ThrottlingSpoolMultiplier">10</Setting>
      <SettingName="ThrottlingTrackingDataMultiplier">10</Setting>
      <SettingName="TimeBasedMaxThreshold">1800</Setting>
      <SettingName="TimeBasedMinThreshold">1</Setting>
      <SettingName="UseDefaultAppDomainForIsolatedAdapter">False</Setting>
      <SettingName="XlangMaxReceiveInterval">500</Setting>
    </Host>
  </HostSettings>
  <HostInstanceSettings>
  </HostInstanceSettings>
</Settings>

Important notes

  • This test uses one host for receiving and sending. In a production environment, you should implement a host separation strategy. Read more about this here
  • The values here may need tuning based on your needs and requirements. They may also cause different test results, which vary with different hardware and software configurations. Thorough testing is vital
  • Test results vary between the first and subsequent batch of messages after host instance restart

How to reproduce this test

  1. Create a BizTalk VM in Azure, or use a different test environment [How?]
    • BizTalk 2013 on Windows Server 2012
    • Use Standard A2 tier
  2. Create a host called SlowlyRunningHost [How?]
  3. Create a host instance using the host from step 2 [How?]
  4. Download the configuration file from the TechNet Gallery, and copy to your BizTalk server
  5. Backup the existing configuration [How?]
  6. Import the configuration file from step 4 [How?]
  7. Create Send and Receive handlers for the new host for the FILE adapter [How?]
  8. Create a new messaging application which moves all files from one folder to another. UseSlowlyRunningHost
  9. Optional: Reduce Batch Size to 1 [How?]
  10. Restart the host instance [How?]

Analysis

This section will illustrate how the host processes messages after implementing the tuning explained above. The application is moving 30 XML-files from one folder to another on the local C-drive of the server. The pipelines arePassThruReceive and PassThruTransmit. The file sizes vary between 11KB and 2336KB.
  • When using the standard BizTalkServerApplication host (with default settings), this process completes in a couple of seconds
  • When using the SlowlyRunningHost, this process completes in about 5 minutes

BizTalk Administration Console

During the test we can see that BizTalk is processing a small amount of messages at the same time, in this case 2. This is as expected.


Figure 4: All In-Progress Service Instances

Performance Monitor

Running Performance Monitor during the test gives us a lot of information. See screenshot below. Some key observations:

  • In-process message count is 2, and In-process message count threshold is 3, which corresponds to theIn-process messages count setting in BizTalk
  • Message delivery delay (ms) and Message publishing delay (ms) is 10000, which corresponds to theMaximum throttling delay setting in BizTalk
  • Message delivery throttling state is 10, and Message publishing throttling state is 11, which means custom/user override throttling
  • Thread count is 56, and Thread count threshold is 3, which incurs throttling and corresponds to the Threads setting in BizTalk

Figure 5: Performance Monitor during test

Performance Analysis of Logs (PAL)

Running PAL during tests provides a lot of details and graphical overview of important performance counters. A few of them will be used here as examples.

Message publishing throttling state: This is 11 during the whole test (over override on publishing)

 
Figure 6: Message publishing throttling state

Message delivery throttling state: This is 10 during the whole test (over override on delivery)


Figure 7: Message delivery throttling state

Message delivery delay (ms): This is 10000 (10 seconds) during the whole test.


Figure 8: Message delivery delay (ms)

See Also

Tags: BizTalk, XML, BizTalk Server, throttling, Has TOC, BizTalk Administration, en-US, has See Also, has Images, has picture

How To Make BizTalk Process Messages Slowly

$
0
0
Revision 4 posted to TechNet Articles by Steef-Jan Wiggers on 8/9/2015 3:03:11 AM


Problem

Normally you want messages in BizTalk to be processed as fast as possible. This is not always the case, especially when BizTalk will deliver messages faster than the receiving system can handle them. I have seen this with systems like IBM ContentManager, which crashes hard when BizTalk pounds it with thousands of messages in short periods. Sometimes you actually want BizTalk to slow down, and process messages at a gentle pace. So what do you do? Develop a custom library in C# to control the load?No!

Solution

BizTalk hosts have a wide variety of configuration options, and can be tuned for specific scenarios like low latency. The built-in throttling functionality will kick in when BizTalk cannot handle the load, but this behavior can also be forced. By changing theResource-Based Throttling and Rate-Based Throttling settings, we can force a host to process messages slowly.

The rest of this article will discuss this configuration file in the TechNet Gallery (SlowlyRunningHost.xml).

Details

The XML configuration file contains several settings, which change the default behaviour of a BizTalk host. The host name in this case isSlowlyRunningHost, and the following details and tests are performed on a standard BizTalk VM running in Azure. An experienced BizTalk administrator should have no problem reproducing this test based on the descriptions and pictures. If you need assistance, view the How to reproduce this test section below, which explains everything step by step.


Figure 1: SlowlyRunningHost in BizTalk Administration Console

To make the host run slowly, we need to alter Resource-Based Throttling settings. To read and modify these settings, right-click yourBizTalk Group in the Administration Console, choose Settings... and thenHosts. Select the SlowlyRunningHost in the dropdown. The "i" icon to the right indicates the value has been changed. For a thorough explanation of all settings, read this article.

Resource-Based Throttling - Configuration Changes

  • Threads: Maximum number of messaging engine threads per CPU. Default value is0, meaning no threshold
  • In-process messages: Maximum number of in-memory in-flight messages allowed before throttling message delivery begins. Default value is1000
  • Internal message queue size: Size of the in-memory queue. This queue serves as a temporary placeholder for delivering messages. Default value is100
  • Message count in DB: Maximum number of items in the database. Default value is50000
  • Severity - Inflight message: Controls the reaction time of throttling when the in-process size exceeds the threshold. Default value is75%


Figure 2: Resouce-Based Throttling

Next, we need to change Rate-Based Throttling settings for the host.

Rate-Based Throttling - Configuration Changes

  • Publishing
    • Minimum number of samples: The number of samples used to determine the rate of message publishing by the service classes of the host. Default value is100
    • Sampling window duration: Time-window beyond which samples will not be considered. Default value is15s
    • Rate overdrive factor: Percentage factor by which the system will overdrive the input rate. Default value is125%
    • Maximum throttling delay: The maximum delay imposed for message publishing throttling. Default value is300s
    • Throttling override: Can be used to override message publishing throttling. Default value isDo Not Override
  • Delivery
    • Minimum number of samples: The number of samples used to determine the rate of message delivery by the service classes of the host. Default value is100
    • Sampling window duration: Time-window beyond which samples will not be considered. Default value is15s
    • Rate overdrive factor: Percentage factor by which the system will overdrive the input rate. Default value is125%
    • Maximum throttling delay: The maximum delay imposed for message delivery throttling. Default value is300s
    • Throttling override: Can be used to override message delivery throttling. Default value isDo Not Override


Figure 3: Rate-Based Throttling

Configuration Settings XML-file

This is the exported XML configuration file which corresponds to the settings explained below. Note that settings not related to the SlowlyRunningHost host have been removed.

<?xmlversion="1.0"encoding="utf-8"?>
  <ExportedGroup>
  </ExportedGroup>
  <GroupSettings>
  </GroupSettings>
  <HostSettings>
    <HostName="SlowlyRunningHost">
      <SettingName="AllowMultipleResponses">False</Setting>
      <SettingName="AuthTrusted">False</Setting>
      <SettingName="DBQueueSizeThreshold">1000</Setting>
      <SettingName="DBSessionThreshold">0</Setting>
      <SettingName="DehydrationBehavior">2</Setting>
      <SettingName="DeliveryQueueSize">1000</Setting>
      <SettingName="GlobalMemoryThreshold">0</Setting>
      <SettingName="HostTracking">False</Setting>
      <SettingName="InflightMessageThreshold">3</Setting>
      <SettingName="IsHost32BitOnly">False</Setting>
      <SettingName="LegacyWhitespace">False</Setting>
      <SettingName="MessageDeliveryMaximumDelay">10000</Setting>
      <SettingName="MessageDeliveryOverdriveFactor">125</Setting>
      <SettingName="MessageDeliverySampleSpaceSize">1</Setting>
      <SettingName="MessageDeliverySampleSpaceWindow">3000</Setting>
      <SettingName="MessagePublishMaximumDelay">10000</Setting>
      <SettingName="MessagePublishOverdriveFactor">100</Setting>
      <SettingName="MessagePublishSampleSpaceSize">1</Setting>
      <SettingName="MessagePublishSampleSpaceWindow">30000</Setting>
      <SettingName="MessagingMaxReceiveInterval">500</Setting>
      <SettingName="MessagingReqRespTTL">20</Setting>
      <SettingName="MsgAgentPerfCounterServiceClassID">0</Setting>
      <SettingName="ProcessMemoryThreshold">25</Setting>
      <SettingName="SubscriptionPauseAt">0</Setting>
      <SettingName="SubscriptionResumeAt">0</Setting>
      <SettingName="ThreadPoolSize">20</Setting>
      <SettingName="ThreadThreshold">3</Setting>
      <SettingName="ThrottlingBatchMemoryThresholdPercent">1</Setting>
      <SettingName="ThrottlingDeliveryOverride">1</Setting>
      <SettingName="ThrottlingDeliveryOverrideSeverity">100</Setting>
      <SettingName="ThrottlingLimitToTriggerGC">80</Setting>
      <SettingName="ThrottlingPublishOverride">1</Setting>
      <SettingName="ThrottlingPublishOverrideSeverity">100</Setting>
      <SettingName="ThrottlingSeverityDatabaseSize">1</Setting>
      <SettingName="ThrottlingSeverityInflightMessage">10</Setting>
      <SettingName="ThrottlingSeverityProcessMemory">500</Setting>
      <SettingName="ThrottlingSpoolMultiplier">10</Setting>
      <SettingName="ThrottlingTrackingDataMultiplier">10</Setting>
      <SettingName="TimeBasedMaxThreshold">1800</Setting>
      <SettingName="TimeBasedMinThreshold">1</Setting>
      <SettingName="UseDefaultAppDomainForIsolatedAdapter">False</Setting>
      <SettingName="XlangMaxReceiveInterval">500</Setting>
    </Host>
  </HostSettings>
  <HostInstanceSettings>
  </HostInstanceSettings>
</Settings>

Important notes

  • This test uses one host for receiving and sending. In a production environment, you should implement a host separation strategy. Read more about this here
  • The values here may need tuning based on your needs and requirements. They may also cause different test results, which vary with different hardware and software configurations. Thorough testing is vital
  • Test results vary between the first and subsequent batch of messages after host instance restart

How to reproduce this test

  1. Create a BizTalk VM in Azure, or use a different test environment [How?]
    • BizTalk 2013 on Windows Server 2012
    • Use Standard A2 tier
  2. Create a host called SlowlyRunningHost [How?]
  3. Create a host instance using the host from step 2 [How?]
  4. Download the configuration file from the TechNet Gallery, and copy to your BizTalk server
  5. Backup the existing configuration [How?]
  6. Import the configuration file from step 4 [How?]
  7. Create Send and Receive handlers for the new host for the FILE adapter [How?]
  8. Create a new messaging application which moves all files from one folder to another. UseSlowlyRunningHost
  9. Optional: Reduce Batch Size to 1 [How?]
  10. Restart the host instance [How?]

Analysis

This section will illustrate how the host processes messages after implementing the tuning explained above. The application is moving 30 XML-files from one folder to another on the local C-drive of the server. The pipelines arePassThruReceive and PassThruTransmit. The file sizes vary between 11KB and 2336KB.
  • When using the standard BizTalkServerApplication host (with default settings), this process completes in a couple of seconds
  • When using the SlowlyRunningHost, this process completes in about 5 minutes

BizTalk Administration Console

During the test we can see that BizTalk is processing a small amount of messages at the same time, in this case 2. This is as expected.


Figure 4: All In-Progress Service Instances

Performance Monitor

Running Performance Monitor during the test gives us a lot of information. See screenshot below. Some key observations:

  • In-process message count is 2, and In-process message count threshold is 3, which corresponds to theIn-process messages count setting in BizTalk
  • Message delivery delay (ms) and Message publishing delay (ms) is 10000, which corresponds to theMaximum throttling delay setting in BizTalk
  • Message delivery throttling state is 10, and Message publishing throttling state is 11, which means custom/user override throttling
  • Thread count is 56, and Thread count threshold is 3, which incurs throttling and corresponds to the Threads setting in BizTalk

Figure 5: Performance Monitor during test

Performance Analysis of Logs (PAL)

Running PAL during tests provides a lot of details and graphical overview of important performance counters. A few of them will be used here as examples.

Message publishing throttling state: This is 11 during the whole test (over override on publishing)

 
Figure 6: Message publishing throttling state

Message delivery throttling state: This is 10 during the whole test (over override on delivery)


Figure 7: Message delivery throttling state

Message delivery delay (ms): This is 10000 (10 seconds) during the whole test.


Figure 8: Message delivery delay (ms)

See Also

Tags: BizTalk, XML, BizTalk Server, throttling, Has TOC, BizTalk Administration, en-US, has See Also, has Images, has picture

How To Make BizTalk Process Messages Slowly

$
0
0
Revision 5 posted to TechNet Articles by Steef-Jan Wiggers on 8/9/2015 3:05:29 AM


Problem

Normally you want messages in BizTalk to be processed as fast as possible. This is not always the case, especially when BizTalk will deliver messages faster than the receiving system can handle them. I have seen this with systems like IBM ContentManager, which crashes hard when BizTalk pounds it with thousands of messages in short periods. Sometimes you actually want BizTalk to slow down, and process messages at a gentle pace. So what do you do? Develop a custom library in C# to control the load?No!

Solution

BizTalk hosts have a wide variety of configuration options, and can be tuned for specific scenarios like low latency. The built-in throttling functionality will kick in when BizTalk cannot handle the load, but this behavior can also be forced. By changing theResource-Based Throttling and Rate-Based Throttling settings, we can force a host to process messages slowly.

The rest of this article will discuss this configuration file in the TechNet Gallery (SlowlyRunningHost.xml).

Details

The XML configuration file contains several settings, which change the default behaviour of a BizTalk host. The host name in this case isSlowlyRunningHost, and the following details and tests are performed on a standard BizTalk VM running in Azure. An experienced BizTalk administrator should have no problem reproducing this test based on the descriptions and pictures. If you need assistance, view the How to reproduce this test section below, which explains everything step by step.


Figure 1: SlowlyRunningHost in BizTalk Administration Console

To make the host run slowly, we need to alter Resource-Based Throttling settings. To read and modify these settings, right-click yourBizTalk Group in the Administration Console, choose Settings... and thenHosts. Select the SlowlyRunningHost in the dropdown. The "i" icon to the right indicates the value has been changed. For a thorough explanation of all settings, read this article.

Resource-Based Throttling - Configuration Changes

  • Threads: Maximum number of messaging engine threads per CPU. Default value is0, meaning no threshold
  • In-process messages: Maximum number of in-memory in-flight messages allowed before throttling message delivery begins. Default value is1000
  • Internal message queue size: Size of the in-memory queue. This queue serves as a temporary placeholder for delivering messages. Default value is100
  • Message count in DB: Maximum number of items in the database. Default value is50000
  • Severity - Inflight message: Controls the reaction time of throttling when the in-process size exceeds the threshold. Default value is75%


Figure 2: Resouce-Based Throttling
Next, we need to change Rate-Based Throttling settings for the host.

Rate-Based Throttling - Configuration Changes

  • Publishing
    • Minimum number of samples: The number of samples used to determine the rate of message publishing by the service classes of the host. Default value is100
    • Sampling window duration: Time-window beyond which samples will not be considered. Default value is15s
    • Rate overdrive factor: Percentage factor by which the system will overdrive the input rate. Default value is125%
    • Maximum throttling delay: The maximum delay imposed for message publishing throttling. Default value is300s
    • Throttling override: Can be used to override message publishing throttling. Default value isDo Not Override
  • Delivery
    • Minimum number of samples: The number of samples used to determine the rate of message delivery by the service classes of the host. Default value is100
    • Sampling window duration: Time-window beyond which samples will not be considered. Default value is15s
    • Rate overdrive factor: Percentage factor by which the system will overdrive the input rate. Default value is125%
    • Maximum throttling delay: The maximum delay imposed for message delivery throttling. Default value is300s
    • Throttling override: Can be used to override message delivery throttling. Default value isDo Not Override


Figure 3: Rate-Based Throttling

Configuration Settings XML-file

This is the exported XML configuration file which corresponds to the settings explained below. Note that settings not related to the SlowlyRunningHost host have been removed.

<?xmlversion="1.0"encoding="utf-8"?>
  <ExportedGroup>
  </ExportedGroup>
  <GroupSettings>
  </GroupSettings>
  <HostSettings>
    <HostName="SlowlyRunningHost">
      <SettingName="AllowMultipleResponses">False</Setting>
      <SettingName="AuthTrusted">False</Setting>
      <SettingName="DBQueueSizeThreshold">1000</Setting>
      <SettingName="DBSessionThreshold">0</Setting>
      <SettingName="DehydrationBehavior">2</Setting>
      <SettingName="DeliveryQueueSize">1000</Setting>
      <SettingName="GlobalMemoryThreshold">0</Setting>
      <SettingName="HostTracking">False</Setting>
      <SettingName="InflightMessageThreshold">3</Setting>
      <SettingName="IsHost32BitOnly">False</Setting>
      <SettingName="LegacyWhitespace">False</Setting>
      <SettingName="MessageDeliveryMaximumDelay">10000</Setting>
      <SettingName="MessageDeliveryOverdriveFactor">125</Setting>
      <SettingName="MessageDeliverySampleSpaceSize">1</Setting>
      <SettingName="MessageDeliverySampleSpaceWindow">3000</Setting>
      <SettingName="MessagePublishMaximumDelay">10000</Setting>
      <SettingName="MessagePublishOverdriveFactor">100</Setting>
      <SettingName="MessagePublishSampleSpaceSize">1</Setting>
      <SettingName="MessagePublishSampleSpaceWindow">30000</Setting>
      <SettingName="MessagingMaxReceiveInterval">500</Setting>
      <SettingName="MessagingReqRespTTL">20</Setting>
      <SettingName="MsgAgentPerfCounterServiceClassID">0</Setting>
      <SettingName="ProcessMemoryThreshold">25</Setting>
      <SettingName="SubscriptionPauseAt">0</Setting>
      <SettingName="SubscriptionResumeAt">0</Setting>
      <SettingName="ThreadPoolSize">20</Setting>
      <SettingName="ThreadThreshold">3</Setting>
      <SettingName="ThrottlingBatchMemoryThresholdPercent">1</Setting>
      <SettingName="ThrottlingDeliveryOverride">1</Setting>
      <SettingName="ThrottlingDeliveryOverrideSeverity">100</Setting>
      <SettingName="ThrottlingLimitToTriggerGC">80</Setting>
      <SettingName="ThrottlingPublishOverride">1</Setting>
      <SettingName="ThrottlingPublishOverrideSeverity">100</Setting>
      <SettingName="ThrottlingSeverityDatabaseSize">1</Setting>
      <SettingName="ThrottlingSeverityInflightMessage">10</Setting>
      <SettingName="ThrottlingSeverityProcessMemory">500</Setting>
      <SettingName="ThrottlingSpoolMultiplier">10</Setting>
      <SettingName="ThrottlingTrackingDataMultiplier">10</Setting>
      <SettingName="TimeBasedMaxThreshold">1800</Setting>
      <SettingName="TimeBasedMinThreshold">1</Setting>
      <SettingName="UseDefaultAppDomainForIsolatedAdapter">False</Setting>
      <SettingName="XlangMaxReceiveInterval">500</Setting>
    </Host>
  </HostSettings>
  <HostInstanceSettings>
  </HostInstanceSettings>
</Settings>

Important notes

  • This test uses one host for receiving and sending. In a production environment, you should implement a host separation strategy. Read more about this here
  • The values here may need tuning based on your needs and requirements. They may also cause different test results, which vary with different hardware and software configurations. Thorough testing is vital
  • Test results vary between the first and subsequent batch of messages after host instance restart

How to reproduce this test

  1. Create a BizTalk VM in Azure, or use a different test environment [How?]
    • BizTalk 2013 on Windows Server 2012
    • Use Standard A2 tier
  2. Create a host called SlowlyRunningHost [How?]
  3. Create a host instance using the host from step 2 [How?]
  4. Download the configuration file from the TechNet Gallery, and copy to your BizTalk server
  5. Backup the existing configuration [How?]
  6. Import the configuration file from step 4 [How?]
  7. Create Send and Receive handlers for the new host for the FILE adapter [How?]
  8. Create a new messaging application which moves all files from one folder to another. UseSlowlyRunningHost
  9. Optional: Reduce Batch Size to 1 [How?]
  10. Restart the host instance [How?]

Analysis

This section will illustrate how the host processes messages after implementing the tuning explained above. The application is moving 30 XML-files from one folder to another on the local C-drive of the server. The pipelines arePassThruReceive and PassThruTransmit. The file sizes vary between 11KB and 2336KB.
  • When using the standard BizTalkServerApplication host (with default settings), this process completes in a couple of seconds
  • When using the SlowlyRunningHost, this process completes in about 5 minutes

BizTalk Administration Console

During the test we can see that BizTalk is processing a small amount of messages at the same time, in this case 2. This is as expected.


Figure 4: All In-Progress Service Instances

Performance Monitor

Running Performance Monitor during the test gives us a lot of information. See screenshot below. Some key observations:

  • In-process message count is 2, and In-process message count threshold is 3, which corresponds to theIn-process messages count setting in BizTalk
  • Message delivery delay (ms) and Message publishing delay (ms) is 10000, which corresponds to theMaximum throttling delay setting in BizTalk
  • Message delivery throttling state is 10, and Message publishing throttling state is 11, which means custom/user override throttling
  • Thread count is 56, and Thread count threshold is 3, which incurs throttling and corresponds to the Threads setting in BizTalk

Figure 5: Performance Monitor during test

Performance Analysis of Logs (PAL)

Running PAL during tests provides a lot of details and graphical overview of important performance counters. A few of them will be used here as examples.

Message publishing throttling state: This is 11 during the whole test (over override on publishing)

 
Figure 6: Message publishing throttling state

Message delivery throttling state: This is 10 during the whole test (over override on delivery)


Figure 7: Message delivery throttling state

Message delivery delay (ms): This is 10000 (10 seconds) during the whole test.


Figure 8: Message delivery delay (ms)

See Also


    Tags: BizTalk, XML, BizTalk Server, throttling, Has TOC, BizTalk Administration, en-US, has See Also, has Images, has picture

    How To Make BizTalk Process Messages Slowly

    $
    0
    0
    Revision 6 posted to TechNet Articles by Steef-Jan Wiggers on 8/9/2015 3:07:07 AM


    Problem

    Normally you want messages in BizTalk to be processed as fast as possible. This is not always the case, especially when BizTalk will deliver messages faster than the receiving system can handle them. I have seen this with systems like IBM ContentManager, which crashes hard when BizTalk pounds it with thousands of messages in short periods. Sometimes you actually want BizTalk to slow down, and process messages at a gentle pace. So what do you do? Develop a custom library in C# to control the load?No!

    Solution

    BizTalk hosts have a wide variety of configuration options, and can be tuned for specific scenarios like low latency. The built-in throttling functionality will kick in when BizTalk cannot handle the load, but this behavior can also be forced. By changing theResource-Based Throttling and Rate-Based Throttling settings, we can force a host to process messages slowly.

    The rest of this article will discuss this configuration file in the TechNet Gallery (SlowlyRunningHost.xml).

    Details

    The XML configuration file contains several settings, which change the default behaviour of a BizTalk host. The host name in this case isSlowlyRunningHost, and the following details and tests are performed on a standard BizTalk VM running in Azure. An experienced BizTalk administrator should have no problem reproducing this test based on the descriptions and pictures. If you need assistance, view the How to reproduce this test section below, which explains everything step by step.


    Figure 1: SlowlyRunningHost in BizTalk Administration Console

    To make the host run slowly, we need to alter Resource-Based Throttling settings. To read and modify these settings, right-click yourBizTalk Group in the Administration Console, choose Settings... and thenHosts. Select the SlowlyRunningHost in the dropdown. The "i" icon to the right indicates the value has been changed. For a thorough explanation of all settings, read this article.

    Resource-Based Throttling - Configuration Changes

    • Threads: Maximum number of messaging engine threads per CPU. Default value is0, meaning no threshold
    • In-process messages: Maximum number of in-memory in-flight messages allowed before throttling message delivery begins. Default value is1000
    • Internal message queue size: Size of the in-memory queue. This queue serves as a temporary placeholder for delivering messages. Default value is100
    • Message count in DB: Maximum number of items in the database. Default value is50000
    • Severity - Inflight message: Controls the reaction time of throttling when the in-process size exceeds the threshold. Default value is75%


    Figure 2: Resouce-Based Throttling
    Next, we need to change Rate-Based Throttling settings for the host.

    Rate-Based Throttling - Configuration Changes

    • Publishing
      • Minimum number of samples: The number of samples used to determine the rate of message publishing by the service classes of the host. Default value is100
      • Sampling window duration: Time-window beyond which samples will not be considered. Default value is15s
      • Rate overdrive factor: Percentage factor by which the system will overdrive the input rate. Default value is125%
      • Maximum throttling delay: The maximum delay imposed for message publishing throttling. Default value is300s
      • Throttling override: Can be used to override message publishing throttling. Default value isDo Not Override
    • Delivery
      • Minimum number of samples: The number of samples used to determine the rate of message delivery by the service classes of the host. Default value is100
      • Sampling window duration: Time-window beyond which samples will not be considered. Default value is15s
      • Rate overdrive factor: Percentage factor by which the system will overdrive the input rate. Default value is125%
      • Maximum throttling delay: The maximum delay imposed for message delivery throttling. Default value is300s
      • Throttling override: Can be used to override message delivery throttling. Default value isDo Not Override


    Figure 3: Rate-Based Throttling

    Configuration Settings XML-file

    This is the exported XML configuration file which corresponds to the settings explained below. Note that settings not related to the SlowlyRunningHost host have been removed.

    <?xmlversion="1.0"encoding="utf-8"?>
      <ExportedGroup>
      </ExportedGroup>
      <GroupSettings>
      </GroupSettings>
      <HostSettings>
        <HostName="SlowlyRunningHost">
          <SettingName="AllowMultipleResponses">False</Setting>
          <SettingName="AuthTrusted">False</Setting>
          <SettingName="DBQueueSizeThreshold">1000</Setting>
          <SettingName="DBSessionThreshold">0</Setting>
          <SettingName="DehydrationBehavior">2</Setting>
          <SettingName="DeliveryQueueSize">1000</Setting>
          <SettingName="GlobalMemoryThreshold">0</Setting>
          <SettingName="HostTracking">False</Setting>
          <SettingName="InflightMessageThreshold">3</Setting>
          <SettingName="IsHost32BitOnly">False</Setting>
          <SettingName="LegacyWhitespace">False</Setting>
          <SettingName="MessageDeliveryMaximumDelay">10000</Setting>
          <SettingName="MessageDeliveryOverdriveFactor">125</Setting>
          <SettingName="MessageDeliverySampleSpaceSize">1</Setting>
          <SettingName="MessageDeliverySampleSpaceWindow">3000</Setting>
          <SettingName="MessagePublishMaximumDelay">10000</Setting>
          <SettingName="MessagePublishOverdriveFactor">100</Setting>
          <SettingName="MessagePublishSampleSpaceSize">1</Setting>
          <SettingName="MessagePublishSampleSpaceWindow">30000</Setting>
          <SettingName="MessagingMaxReceiveInterval">500</Setting>
          <SettingName="MessagingReqRespTTL">20</Setting>
          <SettingName="MsgAgentPerfCounterServiceClassID">0</Setting>
          <SettingName="ProcessMemoryThreshold">25</Setting>
          <SettingName="SubscriptionPauseAt">0</Setting>
          <SettingName="SubscriptionResumeAt">0</Setting>
          <SettingName="ThreadPoolSize">20</Setting>
          <SettingName="ThreadThreshold">3</Setting>
          <SettingName="ThrottlingBatchMemoryThresholdPercent">1</Setting>
          <SettingName="ThrottlingDeliveryOverride">1</Setting>
          <SettingName="ThrottlingDeliveryOverrideSeverity">100</Setting>
          <SettingName="ThrottlingLimitToTriggerGC">80</Setting>
          <SettingName="ThrottlingPublishOverride">1</Setting>
          <SettingName="ThrottlingPublishOverrideSeverity">100</Setting>
          <SettingName="ThrottlingSeverityDatabaseSize">1</Setting>
          <SettingName="ThrottlingSeverityInflightMessage">10</Setting>
          <SettingName="ThrottlingSeverityProcessMemory">500</Setting>
          <SettingName="ThrottlingSpoolMultiplier">10</Setting>
          <SettingName="ThrottlingTrackingDataMultiplier">10</Setting>
          <SettingName="TimeBasedMaxThreshold">1800</Setting>
          <SettingName="TimeBasedMinThreshold">1</Setting>
          <SettingName="UseDefaultAppDomainForIsolatedAdapter">False</Setting>
          <SettingName="XlangMaxReceiveInterval">500</Setting>
        </Host>
      </HostSettings>
      <HostInstanceSettings>
      </HostInstanceSettings>
    </Settings>

    Important notes

    • This test uses one host for receiving and sending. In a production environment, you should implement a host separation strategy. Read more about this here
    • The values here may need tuning based on your needs and requirements. They may also cause different test results, which vary with different hardware and software configurations. Thorough testing is vital
    • Test results vary between the first and subsequent batch of messages after host instance restart

    How to reproduce this test

    1. Create a BizTalk VM in Azure, or use a different test environment [How?]
      • BizTalk 2013 on Windows Server 2012
      • Use Standard A2 tier
    2. Create a host called SlowlyRunningHost [How?]
    3. Create a host instance using the host from step 2 [How?]
    4. Download the configuration file from the TechNet Gallery, and copy to your BizTalk server
    5. Backup the existing configuration [How?]
    6. Import the configuration file from step 4 [How?]
    7. Create Send and Receive handlers for the new host for the FILE adapter [How?]
    8. Create a new messaging application which moves all files from one folder to another. UseSlowlyRunningHost
    9. Optional: Reduce Batch Size to 1 [How?]
    10. Restart the host instance [How?]

    Analysis

    This section will illustrate how the host processes messages after implementing the tuning explained above. The application is moving 30 XML-files from one folder to another on the local C-drive of the server. The pipelines arePassThruReceive and PassThruTransmit. The file sizes vary between 11KB and 2336KB.
    • When using the standard BizTalkServerApplication host (with default settings), this process completes in a couple of seconds
    • When using the SlowlyRunningHost, this process completes in about 5 minutes

    BizTalk Administration Console

    During the test we can see that BizTalk is processing a small amount of messages at the same time, in this case 2. This is as expected.


    Figure 4: All In-Progress Service Instances

    Performance Monitor

    Running Performance Monitor during the test gives us a lot of information. See screenshot below. Some key observations:

    • In-process message count is 2, and In-process message count threshold is 3, which corresponds to theIn-process messages count setting in BizTalk
    • Message delivery delay (ms) and Message publishing delay (ms) is 10000, which corresponds to theMaximum throttling delay setting in BizTalk
    • Message delivery throttling state is 10, and Message publishing throttling state is 11, which means custom/user override throttling
    • Thread count is 56, and Thread count threshold is 3, which incurs throttling and corresponds to the Threads setting in BizTalk

    Figure 5: Performance Monitor during test

    Performance Analysis of Logs (PAL)

    Running PAL during tests provides a lot of details and graphical overview of important performance counters. A few of them will be used here as examples.

    Message publishing throttling state: This is 11 during the whole test (over override on publishing)

     
    Figure 6: Message publishing throttling state

    Message delivery throttling state: This is 10 during the whole test (over override on delivery)


    Figure 7: Message delivery throttling state

    Message delivery delay (ms): This is 10000 (10 seconds) during the whole test.


    Figure 8: Message delivery delay (ms)

    See Also

    Another important place to find an extensive amount of BizTalk related articles is the TechNet Wiki itself. The best entry point is BizTalk Server Resources on the TechNet Wiki.

      Tags: BizTalk, XML, BizTalk Server, throttling, Has TOC, BizTalk Administration, en-US, has See Also, has Images, has picture

      How To Make BizTalk Process Messages Slowly

      $
      0
      0
      Revision 7 posted to TechNet Articles by Steef-Jan Wiggers on 8/9/2015 3:09:01 AM

      Problem

      Normally you want messages in BizTalk to be processed as fast as possible. This is not always the case, especially when BizTalk will deliver messages faster than the receiving system can handle them. I have seen this with systems like IBM ContentManager, which crashes hard when BizTalk pounds it with thousands of messages in short periods. Sometimes you actually want BizTalk to slow down, and process messages at a gentle pace. So what do you do? Develop a custom library in C# to control the load?No!

      Solution

      BizTalk hosts have a wide variety of configuration options, and can be tuned for specific scenarios like low latency. The built-in throttling functionality will kick in when BizTalk cannot handle the load, but this behavior can also be forced. By changing theResource-Based Throttling and Rate-Based Throttling settings, we can force a host to process messages slowly.

      The rest of this article will discuss this configuration file in the TechNet Gallery (SlowlyRunningHost.xml).

      Details

      The XML configuration file contains several settings, which change the default behaviour of a BizTalk host. The host name in this case isSlowlyRunningHost, and the following details and tests are performed on a standard BizTalk VM running in Azure. An experienced BizTalk administrator should have no problem reproducing this test based on the descriptions and pictures. If you need assistance, view the How to reproduce this test section below, which explains everything step by step.


      Figure 1: SlowlyRunningHost in BizTalk Administration Console

      To make the host run slowly, we need to alter Resource-Based Throttling settings. To read and modify these settings, right-click yourBizTalk Group in the Administration Console, choose Settings... and thenHosts. Select the SlowlyRunningHost in the dropdown. The "i" icon to the right indicates the value has been changed. For a thorough explanation of all settings, read this article.

      Resource-Based Throttling - Configuration Changes

      • Threads: Maximum number of messaging engine threads per CPU. Default value is0, meaning no threshold
      • In-process messages: Maximum number of in-memory in-flight messages allowed before throttling message delivery begins. Default value is1000
      • Internal message queue size: Size of the in-memory queue. This queue serves as a temporary placeholder for delivering messages. Default value is100
      • Message count in DB: Maximum number of items in the database. Default value is50000
      • Severity - Inflight message: Controls the reaction time of throttling when the in-process size exceeds the threshold. Default value is75%

      Figure 2: Resouce-Based Throttling
      Next, we need to change Rate-Based Throttling settings for the host.

      Rate-Based Throttling - Configuration Changes

      • Publishing
        • Minimum number of samples: The number of samples used to determine the rate of message publishing by the service classes of the host. Default value is100
        • Sampling window duration: Time-window beyond which samples will not be considered. Default value is15s
        • Rate overdrive factor: Percentage factor by which the system will overdrive the input rate. Default value is125%
        • Maximum throttling delay: The maximum delay imposed for message publishing throttling. Default value is300s
        • Throttling override: Can be used to override message publishing throttling. Default value isDo Not Override
      • Delivery
        • Minimum number of samples: The number of samples used to determine the rate of message delivery by the service classes of the host. Default value is100
        • Sampling window duration: Time-window beyond which samples will not be considered. Default value is15s
        • Rate overdrive factor: Percentage factor by which the system will overdrive the input rate. Default value is125%
        • Maximum throttling delay: The maximum delay imposed for message delivery throttling. Default value is300s
        • Throttling override: Can be used to override message delivery throttling. Default value isDo Not Override

      Figure 3: Rate-Based Throttling

      Configuration Settings XML-file

      This is the exported XML configuration file which corresponds to the settings explained below. Note that settings not related to the SlowlyRunningHost host have been removed.

      <?xmlversion="1.0"encoding="utf-8"?>
        <ExportedGroup>
        </ExportedGroup>
        <GroupSettings>
        </GroupSettings>
        <HostSettings>
          <HostName="SlowlyRunningHost">
            <SettingName="AllowMultipleResponses">False</Setting>
            <SettingName="AuthTrusted">False</Setting>
            <SettingName="DBQueueSizeThreshold">1000</Setting>
            <SettingName="DBSessionThreshold">0</Setting>
            <SettingName="DehydrationBehavior">2</Setting>
            <SettingName="DeliveryQueueSize">1000</Setting>
            <SettingName="GlobalMemoryThreshold">0</Setting>
            <SettingName="HostTracking">False</Setting>
            <SettingName="InflightMessageThreshold">3</Setting>
            <SettingName="IsHost32BitOnly">False</Setting>
            <SettingName="LegacyWhitespace">False</Setting>
            <SettingName="MessageDeliveryMaximumDelay">10000</Setting>
            <SettingName="MessageDeliveryOverdriveFactor">125</Setting>
            <SettingName="MessageDeliverySampleSpaceSize">1</Setting>
            <SettingName="MessageDeliverySampleSpaceWindow">3000</Setting>
            <SettingName="MessagePublishMaximumDelay">10000</Setting>
            <SettingName="MessagePublishOverdriveFactor">100</Setting>
            <SettingName="MessagePublishSampleSpaceSize">1</Setting>
            <SettingName="MessagePublishSampleSpaceWindow">30000</Setting>
            <SettingName="MessagingMaxReceiveInterval">500</Setting>
            <SettingName="MessagingReqRespTTL">20</Setting>
            <SettingName="MsgAgentPerfCounterServiceClassID">0</Setting>
            <SettingName="ProcessMemoryThreshold">25</Setting>
            <SettingName="SubscriptionPauseAt">0</Setting>
            <SettingName="SubscriptionResumeAt">0</Setting>
            <SettingName="ThreadPoolSize">20</Setting>
            <SettingName="ThreadThreshold">3</Setting>
            <SettingName="ThrottlingBatchMemoryThresholdPercent">1</Setting>
            <SettingName="ThrottlingDeliveryOverride">1</Setting>
            <SettingName="ThrottlingDeliveryOverrideSeverity">100</Setting>
            <SettingName="ThrottlingLimitToTriggerGC">80</Setting>
            <SettingName="ThrottlingPublishOverride">1</Setting>
            <SettingName="ThrottlingPublishOverrideSeverity">100</Setting>
            <SettingName="ThrottlingSeverityDatabaseSize">1</Setting>
            <SettingName="ThrottlingSeverityInflightMessage">10</Setting>
            <SettingName="ThrottlingSeverityProcessMemory">500</Setting>
            <SettingName="ThrottlingSpoolMultiplier">10</Setting>
            <SettingName="ThrottlingTrackingDataMultiplier">10</Setting>
            <SettingName="TimeBasedMaxThreshold">1800</Setting>
            <SettingName="TimeBasedMinThreshold">1</Setting>
            <SettingName="UseDefaultAppDomainForIsolatedAdapter">False</Setting>
            <SettingName="XlangMaxReceiveInterval">500</Setting>
          </Host>
        </HostSettings>
        <HostInstanceSettings>
        </HostInstanceSettings>
      </Settings>

      Important notes

      • This test uses one host for receiving and sending. In a production environment, you should implement a host separation strategy. Read more about this here
      • The values here may need tuning based on your needs and requirements. They may also cause different test results, which vary with different hardware and software configurations. Thorough testing is vital
      • Test results vary between the first and subsequent batch of messages after host instance restart

      How to reproduce this test

      1. Create a BizTalk VM in Azure, or use a different test environment [How?]
        • BizTalk 2013 on Windows Server 2012
        • Use Standard A2 tier
      2. Create a host called SlowlyRunningHost [How?]
      3. Create a host instance using the host from step 2 [How?]
      4. Download the configuration file from the TechNet Gallery, and copy to your BizTalk server
      5. Backup the existing configuration [How?]
      6. Import the configuration file from step 4 [How?]
      7. Create Send and Receive handlers for the new host for the FILE adapter [How?]
      8. Create a new messaging application which moves all files from one folder to another. UseSlowlyRunningHost
      9. Optional: Reduce Batch Size to 1 [How?]
      10. Restart the host instance [How?]

      Analysis

      This section will illustrate how the host processes messages after implementing the tuning explained above. The application is moving 30 XML-files from one folder to another on the local C-drive of the server. The pipelines arePassThruReceive and PassThruTransmit. The file sizes vary between 11KB and 2336KB.
      • When using the standard BizTalkServerApplication host (with default settings), this process completes in a couple of seconds
      • When using the SlowlyRunningHost, this process completes in about 5 minutes

      BizTalk Administration Console

      During the test we can see that BizTalk is processing a small amount of messages at the same time, in this case 2. This is as expected.


      Figure 4: All In-Progress Service Instances

      Performance Monitor

      Running Performance Monitor during the test gives us a lot of information. See screenshot below. Some key observations:

      • In-process message count is 2, and In-process message count threshold is 3, which corresponds to theIn-process messages count setting in BizTalk
      • Message delivery delay (ms) and Message publishing delay (ms) is 10000, which corresponds to theMaximum throttling delay setting in BizTalk
      • Message delivery throttling state is 10, and Message publishing throttling state is 11, which means custom/user override throttling
      • Thread count is 56, and Thread count threshold is 3, which incurs throttling and corresponds to the Threads setting in BizTalk

      Figure 5: Performance Monitor during test

      Performance Analysis of Logs (PAL)

      Running PAL during tests provides a lot of details and graphical overview of important performance counters. A few of them will be used here as examples.

      Message publishing throttling state: This is 11 during the whole test (over override on publishing)
       
      Figure 6: Message publishing throttling state

      Message delivery throttling state: This is 10 during the whole test (over override on delivery)

      Figure 7: Message delivery throttling state

      Message delivery delay (ms): This is 10000 (10 seconds) during the whole test.


      Figure 8: Message delivery delay (ms)

      See Also

      Another important place to find an extensive amount of BizTalk related articles is the TechNet Wiki itself. The best entry point is BizTalk Server Resources on the TechNet Wiki.

        Tags: BizTalk, XML, BizTalk Server, throttling, Has TOC, BizTalk Administration, en-US, has See Also, has Images, has picture

        How To Make BizTalk Process Messages Slowly

        $
        0
        0
        Revision 8 posted to TechNet Articles by Steef-Jan Wiggers on 8/9/2015 3:22:29 AM

        Problem

        Normally you want messages in BizTalk to be processed as fast as possible. This is not always the case, especially when BizTalk will deliver messages faster than the receiving system can handle them. I have seen this with systems like IBM ContentManager, which crashes hard when BizTalk pounds it with thousands of messages in short periods. Sometimes you actually want BizTalk to slow down, and process messages at a gentle pace. So what do you do? Develop a custom library in C# to control the load?No!

        Solution

        BizTalk hosts have a wide variety of configuration options, and can be tuned for specific scenarios like low latency. The built-in throttling functionality will kick in when BizTalk cannot handle the load, but this behavior can also be forced. By changing theResource-Based Throttling and Rate-Based Throttling settings, we can force a host to process messages slowly.

        The rest of this article will discuss this configuration file in the TechNet Gallery (SlowlyRunningHost.xml).

        Details

        The XML configuration file contains several settings, which change the default behaviour of a BizTalk host. The host name in this case isSlowlyRunningHost, and the following details and tests are performed on a standard BizTalk VM running in Azure. An experienced BizTalk administrator should have no problem reproducing this test based on the descriptions and pictures. If you need assistance, view the How to reproduce this test section below, which explains everything step by step.


        Figure 1: SlowlyRunningHost in BizTalk Administration Console

        To make the host run slowly, we need to alter Resource-Based Throttling settings. To read and modify these settings, right-click yourBizTalk Group in the Administration Console, choose Settings... and thenHosts. Select the SlowlyRunningHost in the dropdown. The "i" icon to the right indicates the value has been changed. For a thorough explanation of all settings, read this article.

        Resource-Based Throttling - Configuration Changes

        • Threads: Maximum number of messaging engine threads per CPU. Default value is0, meaning no threshold
        • In-process messages: Maximum number of in-memory in-flight messages allowed before throttling message delivery begins. Default value is1000
        • Internal message queue size: Size of the in-memory queue. This queue serves as a temporary placeholder for delivering messages. Default value is100
        • Message count in DB: Maximum number of items in the database. Default value is50000
        • Severity - Inflight message: Controls the reaction time of throttling when the in-process size exceeds the threshold. Default value is75%

        Figure 2: Resouce-Based Throttling
        Next, we need to change Rate-Based Throttling settings for the host.

        Rate-Based Throttling - Configuration Changes

        • Publishing
          • Minimum number of samples: The number of samples used to determine the rate of message publishing by the service classes of the host. Default value is100
          • Sampling window duration: Time-window beyond which samples will not be considered. Default value is15s
          • Rate overdrive factor: Percentage factor by which the system will overdrive the input rate. Default value is125%
          • Maximum throttling delay: The maximum delay imposed for message publishing throttling. Default value is300s
          • Throttling override: Can be used to override message publishing throttling. Default value isDo Not Override
        • Delivery
          • Minimum number of samples: The number of samples used to determine the rate of message delivery by the service classes of the host. Default value is100
          • Sampling window duration: Time-window beyond which samples will not be considered. Default value is15s
          • Rate overdrive factor: Percentage factor by which the system will overdrive the input rate. Default value is125%
          • Maximum throttling delay: The maximum delay imposed for message delivery throttling. Default value is300s
          • Throttling override: Can be used to override message delivery throttling. Default value isDo Not Override

        Figure 3: Rate-Based Throttling

        Configuration Settings XML-file

        This is the exported XML configuration file which corresponds to the settings explained below. Note that settings not related to the SlowlyRunningHost host have been removed.

        <?xmlversion="1.0"encoding="utf-8"?>
          <ExportedGroup>
          </ExportedGroup>
          <GroupSettings>
          </GroupSettings>
          <HostSettings>
            <HostName="SlowlyRunningHost">
              <SettingName="AllowMultipleResponses">False</Setting>
              <SettingName="AuthTrusted">False</Setting>
              <SettingName="DBQueueSizeThreshold">1000</Setting>
              <SettingName="DBSessionThreshold">0</Setting>
              <SettingName="DehydrationBehavior">2</Setting>
              <SettingName="DeliveryQueueSize">1000</Setting>
              <SettingName="GlobalMemoryThreshold">0</Setting>
              <SettingName="HostTracking">False</Setting>
              <SettingName="InflightMessageThreshold">3</Setting>
              <SettingName="IsHost32BitOnly">False</Setting>
              <SettingName="LegacyWhitespace">False</Setting>
              <SettingName="MessageDeliveryMaximumDelay">10000</Setting>
              <SettingName="MessageDeliveryOverdriveFactor">125</Setting>
              <SettingName="MessageDeliverySampleSpaceSize">1</Setting>
              <SettingName="MessageDeliverySampleSpaceWindow">3000</Setting>
              <SettingName="MessagePublishMaximumDelay">10000</Setting>
              <SettingName="MessagePublishOverdriveFactor">100</Setting>
              <SettingName="MessagePublishSampleSpaceSize">1</Setting>
              <SettingName="MessagePublishSampleSpaceWindow">30000</Setting>
              <SettingName="MessagingMaxReceiveInterval">500</Setting>
              <SettingName="MessagingReqRespTTL">20</Setting>
              <SettingName="MsgAgentPerfCounterServiceClassID">0</Setting>
              <SettingName="ProcessMemoryThreshold">25</Setting>
              <SettingName="SubscriptionPauseAt">0</Setting>
              <SettingName="SubscriptionResumeAt">0</Setting>
              <SettingName="ThreadPoolSize">20</Setting>
              <SettingName="ThreadThreshold">3</Setting>
              <SettingName="ThrottlingBatchMemoryThresholdPercent">1</Setting>
              <SettingName="ThrottlingDeliveryOverride">1</Setting>
              <SettingName="ThrottlingDeliveryOverrideSeverity">100</Setting>
              <SettingName="ThrottlingLimitToTriggerGC">80</Setting>
              <SettingName="ThrottlingPublishOverride">1</Setting>
              <SettingName="ThrottlingPublishOverrideSeverity">100</Setting>
              <SettingName="ThrottlingSeverityDatabaseSize">1</Setting>
              <SettingName="ThrottlingSeverityInflightMessage">10</Setting>
              <SettingName="ThrottlingSeverityProcessMemory">500</Setting>
              <SettingName="ThrottlingSpoolMultiplier">10</Setting>
              <SettingName="ThrottlingTrackingDataMultiplier">10</Setting>
              <SettingName="TimeBasedMaxThreshold">1800</Setting>
              <SettingName="TimeBasedMinThreshold">1</Setting>
              <SettingName="UseDefaultAppDomainForIsolatedAdapter">False</Setting>
              <SettingName="XlangMaxReceiveInterval">500</Setting>
            </Host>
          </HostSettings>
          <HostInstanceSettings>
          </HostInstanceSettings>
        </Settings>

        Important notes

        • This test uses one host for receiving and sending. In a production environment, you should implement a host separation strategy. Read more about this here
        • The values here may need tuning based on your needs and requirements. They may also cause different test results, which vary with different hardware and software configurations. Thorough testing is vital
        • Test results vary between the first and subsequent batch of messages after host instance restart

        How to reproduce this test

        1. Create a BizTalk VM in Azure, or use a different test environment [How?]
          • BizTalk 2013 on Windows Server 2012
          • Use Standard A2 tier
        2. Create a host called SlowlyRunningHost [How?]
        3. Create a host instance using the host from step 2 [How?]
        4. Download the configuration file from the TechNet Gallery, and copy to your BizTalk server
        5. Backup the existing configuration [How?]
        6. Import the configuration file from step 4 [How?]
        7. Create Send and Receive handlers for the new host for the FILE adapter [How?]
        8. Create a new messaging application which moves all files from one folder to another. UseSlowlyRunningHost
        9. Optional: Reduce Batch Size to 1 [How?]
        10. Restart the host instance [How?]

        Analysis

        This section will illustrate how the host processes messages after implementing the tuning explained above. The application is moving 30 XML-files from one folder to another on the local C-drive of the server. The pipelines arePassThruReceive and PassThruTransmit. The file sizes vary between 11KB and 2336KB.
        • When using the standard BizTalkServerApplication host (with default settings), this process completes in a couple of seconds
        • When using the SlowlyRunningHost, this process completes in about 5 minutes

        BizTalk Administration Console

        During the test we can see that BizTalk is processing a small amount of messages at the same time, in this case 2. This is as expected.


        Figure 4: All In-Progress Service Instances

        Performance Monitor

        Running Performance Monitor during the test gives us a lot of information. See screenshot below. Some key observations:

        • In-process message count is 2, and In-process message count threshold is 3, which corresponds to theIn-process messages count setting in BizTalk
        • Message delivery delay (ms) and Message publishing delay (ms) is 10000, which corresponds to theMaximum throttling delay setting in BizTalk
        • Message delivery throttling state is 10, and Message publishing throttling state is 11, which means custom/user override throttling
        • Thread count is 56, and Thread count threshold is 3, which incurs throttling and corresponds to the Threads setting in BizTalk

        Figure 5: Performance Monitor during test

        Performance Analysis of Logs (PAL)

        Running PAL during tests provides a lot of details and graphical overview of important performance counters. A few of them will be used here as examples.

        Message publishing throttling state: This is 11 during the whole test (over override on publishing)
         
        Figure 6: Message publishing throttling state

        Message delivery throttling state: This is 10 during the whole test (over override on delivery)

        Figure 7: Message delivery throttling state

        Message delivery delay (ms): This is 10000 (10 seconds) during the whole test.


        Figure 8: Message delivery delay (ms)

        See Also

        Another important place to find an extensive amount of BizTalk related articles is the TechNet Wiki itself. The best entry point is BizTalk Server Resources on the TechNet Wiki.

          Tags: BizTalk, XML, BizTalk Server, throttling, Has TOC, BizTalk Administration, en-US, has See Also, has Images, has picture, Kjetil Tonstad

          How To Make BizTalk Process Messages Slowly

          $
          0
          0
          Revision 9 posted to TechNet Articles by Ken Cenerelli on 9/19/2015 6:58:53 PM

          Problem

          Normally you want messages in BizTalk to be processed as fast as possible. This is not always the case, especially when BizTalk will deliver messages faster than the receiving system can handle them. I have seen this with systems like IBM ContentManager, which crashes hard when BizTalk pounds it with thousands of messages in short periods. Sometimes you actually want BizTalk to slow down, and process messages at a gentle pace. So what do you do? Develop a custom library in C# to control the load?No!

          Solution

          BizTalk hosts have a wide variety of configuration options, and can be tuned for specific scenarios like low latency. The built-in throttling functionality will kick in when BizTalk cannot handle the load, but this behavior can also be forced. By changing theResource-Based Throttling and Rate-Based Throttling settings, we can force a host to process messages slowly.

          The rest of this article will discuss this configuration file in the TechNet Gallery (SlowlyRunningHost.xml).

          Details

          The XML configuration file contains several settings, which change the default behaviour of a BizTalk host. The host name in this case isSlowlyRunningHost, and the following details and tests are performed on a standard BizTalk VM running in Azure. An experienced BizTalk administrator should have no problem reproducing this test based on the descriptions and pictures. If you need assistance, view the How to reproduce this test section below, which explains everything step by step.


          Figure 1: SlowlyRunningHost in BizTalk Administration Console

          To make the host run slowly, we need to alter Resource-Based Throttling settings. To read and modify these settings, right-click yourBizTalk Group in the Administration Console, choose Settings... and thenHosts. Select the SlowlyRunningHost in the dropdown. The "i" icon to the right indicates the value has been changed. For a thorough explanation of all settings, read this article.

          Resource-Based Throttling - Configuration Changes

          • Threads: Maximum number of messaging engine threads per CPU. Default value is0, meaning no threshold
          • In-process messages: Maximum number of in-memory in-flight messages allowed before throttling message delivery begins. Default value is1000
          • Internal message queue size: Size of the in-memory queue. This queue serves as a temporary placeholder for delivering messages. Default value is100
          • Message count in DB: Maximum number of items in the database. Default value is50000
          • Severity - Inflight message: Controls the reaction time of throttling when the in-process size exceeds the threshold. Default value is75%

          Figure 2: Resouce-Based Throttling
          Next, we need to change Rate-Based Throttling settings for the host.

          Rate-Based Throttling - Configuration Changes

          • Publishing
            • Minimum number of samples: The number of samples used to determine the rate of message publishing by the service classes of the host. Default value is100
            • Sampling window duration: Time-window beyond which samples will not be considered. Default value is15s
            • Rate overdrive factor: Percentage factor by which the system will overdrive the input rate. Default value is125%
            • Maximum throttling delay: The maximum delay imposed for message publishing throttling. Default value is300s
            • Throttling override: Can be used to override message publishing throttling. Default value isDo Not Override
          • Delivery
            • Minimum number of samples: The number of samples used to determine the rate of message delivery by the service classes of the host. Default value is100
            • Sampling window duration: Time-window beyond which samples will not be considered. Default value is15s
            • Rate overdrive factor: Percentage factor by which the system will overdrive the input rate. Default value is125%
            • Maximum throttling delay: The maximum delay imposed for message delivery throttling. Default value is300s
            • Throttling override: Can be used to override message delivery throttling. Default value isDo Not Override

          Figure 3: Rate-Based Throttling

          Configuration Settings XML-file

          This is the exported XML configuration file which corresponds to the settings explained below. Note that settings not related to the SlowlyRunningHost host have been removed.

          <?xmlversion="1.0"encoding="utf-8"?>
            <ExportedGroup>
            </ExportedGroup>
            <GroupSettings>
            </GroupSettings>
            <HostSettings>
              <HostName="SlowlyRunningHost">
                <SettingName="AllowMultipleResponses">False</Setting>
                <SettingName="AuthTrusted">False</Setting>
                <SettingName="DBQueueSizeThreshold">1000</Setting>
                <SettingName="DBSessionThreshold">0</Setting>
                <SettingName="DehydrationBehavior">2</Setting>
                <SettingName="DeliveryQueueSize">1000</Setting>
                <SettingName="GlobalMemoryThreshold">0</Setting>
                <SettingName="HostTracking">False</Setting>
                <SettingName="InflightMessageThreshold">3</Setting>
                <SettingName="IsHost32BitOnly">False</Setting>
                <SettingName="LegacyWhitespace">False</Setting>
                <SettingName="MessageDeliveryMaximumDelay">10000</Setting>
                <SettingName="MessageDeliveryOverdriveFactor">125</Setting>
                <SettingName="MessageDeliverySampleSpaceSize">1</Setting>
                <SettingName="MessageDeliverySampleSpaceWindow">3000</Setting>
                <SettingName="MessagePublishMaximumDelay">10000</Setting>
                <SettingName="MessagePublishOverdriveFactor">100</Setting>
                <SettingName="MessagePublishSampleSpaceSize">1</Setting>
                <SettingName="MessagePublishSampleSpaceWindow">30000</Setting>
                <SettingName="MessagingMaxReceiveInterval">500</Setting>
                <SettingName="MessagingReqRespTTL">20</Setting>
                <SettingName="MsgAgentPerfCounterServiceClassID">0</Setting>
                <SettingName="ProcessMemoryThreshold">25</Setting>
                <SettingName="SubscriptionPauseAt">0</Setting>
                <SettingName="SubscriptionResumeAt">0</Setting>
                <SettingName="ThreadPoolSize">20</Setting>
                <SettingName="ThreadThreshold">3</Setting>
                <SettingName="ThrottlingBatchMemoryThresholdPercent">1</Setting>
                <SettingName="ThrottlingDeliveryOverride">1</Setting>
                <SettingName="ThrottlingDeliveryOverrideSeverity">100</Setting>
                <SettingName="ThrottlingLimitToTriggerGC">80</Setting>
                <SettingName="ThrottlingPublishOverride">1</Setting>
                <SettingName="ThrottlingPublishOverrideSeverity">100</Setting>
                <SettingName="ThrottlingSeverityDatabaseSize">1</Setting>
                <SettingName="ThrottlingSeverityInflightMessage">10</Setting>
                <SettingName="ThrottlingSeverityProcessMemory">500</Setting>
                <SettingName="ThrottlingSpoolMultiplier">10</Setting>
                <SettingName="ThrottlingTrackingDataMultiplier">10</Setting>
                <SettingName="TimeBasedMaxThreshold">1800</Setting>
                <SettingName="TimeBasedMinThreshold">1</Setting>
                <SettingName="UseDefaultAppDomainForIsolatedAdapter">False</Setting>
                <SettingName="XlangMaxReceiveInterval">500</Setting>
              </Host>
            </HostSettings>
            <HostInstanceSettings>
            </HostInstanceSettings>
          </Settings>

          Important notes

          • This test uses one host for receiving and sending. In a production environment, you should implement a host separation strategy. Read more about this here
          • The values here may need tuning based on your needs and requirements. They may also cause different test results, which vary with different hardware and software configurations. Thorough testing is vital
          • Test results vary between the first and subsequent batch of messages after host instance restart

          How to reproduce this test

          1. Create a BizTalk VM in Azure, or use a different test environment [How?]
            • BizTalk 2013 on Windows Server 2012
            • Use Standard A2 tier
          2. Create a host called SlowlyRunningHost [How?]
          3. Create a host instance using the host from step 2 [How?]
          4. Download the configuration file from the TechNet Gallery, and copy to your BizTalk server
          5. Backup the existing configuration [How?]
          6. Import the configuration file from step 4 [How?]
          7. Create Send and Receive handlers for the new host for the FILE adapter [How?]
          8. Create a new messaging application which moves all files from one folder to another. UseSlowlyRunningHost
          9. Optional: Reduce Batch Size to 1 [How?]
          10. Restart the host instance [How?]

          Analysis

          This section will illustrate how the host processes messages after implementing the tuning explained above. The application is moving 30 XML-files from one folder to another on the local C-drive of the server. The pipelines arePassThruReceive and PassThruTransmit. The file sizes vary between 11KB and 2336KB.
          • When using the standard BizTalkServerApplication host (with default settings), this process completes in a couple of seconds
          • When using the SlowlyRunningHost, this process completes in about 5 minutes

          BizTalk Administration Console

          During the test we can see that BizTalk is processing a small amount of messages at the same time, in this case 2. This is as expected.


          Figure 4: All In-Progress Service Instances

          Performance Monitor

          Running Performance Monitor during the test gives us a lot of information. See screenshot below. Some key observations:

          • In-process message count is 2, and In-process message count threshold is 3, which corresponds to theIn-process messages count setting in BizTalk
          • Message delivery delay (ms) and Message publishing delay (ms) is 10000, which corresponds to theMaximum throttling delay setting in BizTalk
          • Message delivery throttling state is 10, and Message publishing throttling state is 11, which means custom/user override throttling
          • Thread count is 56, and Thread count threshold is 3, which incurs throttling and corresponds to the Threads setting in BizTalk

          Figure 5: Performance Monitor during test

          Performance Analysis of Logs (PAL)

          Running PAL during tests provides a lot of details and graphical overview of important performance counters. A few of them will be used here as examples.

          Message publishing throttling state: This is 11 during the whole test (over override on publishing)
           
          Figure 6: Message publishing throttling state

          Message delivery throttling state: This is 10 during the whole test (over override on delivery)

          Figure 7: Message delivery throttling state

          Message delivery delay (ms): This is 10000 (10 seconds) during the whole test.


          Figure 8: Message delivery delay (ms)

          See Also

          Another important place to find an extensive amount of BizTalk related articles is the TechNet Wiki itself. The best entry point is BizTalk Server Resources on the TechNet Wiki.

            Tags: BizTalk, XML, has code, BizTalk Server, throttling, Has TOC, BizTalk Administration, en-US, has comment, has See Also, has Images, has picture, Kjetil Tonstad

            How To Make BizTalk Process Messages Slowly

            $
            0
            0
            Revision 10 posted to TechNet Articles by Edward van Biljon on 9/25/2015 12:49:27 AM

            Problem

            Normally you want messages in BizTalk to be processed as fast as possible. This is not always the case, especially when BizTalk will deliver messages faster than the receiving system can handle them. I have seen this with systems like IBM ContentManager, which crashes hard when BizTalk pounds it with thousands of messages in short periods. Sometimes you actually want BizTalk to slow down, and process messages at a gentle pace. So what do you do? Develop a custom library in C# to control the load?No!

            Solution

            BizTalk hosts have a wide variety of configuration options, and can be tuned for specific scenarios like low latency. The built-in throttling functionality will kick in when BizTalk cannot handle the load, but this behavior can also be forced. By changing theResource-Based Throttling and Rate-Based Throttling settings, we can force a host to process messages slowly.

            The rest of this article will discuss this configuration file in the TechNet Gallery (SlowlyRunningHost.xml).

            Details

            The XML configuration file contains several settings, which change the default behaviour of a BizTalk host. The host name in this case isSlowlyRunningHost, and the following details and tests are performed on a standard BizTalk VM running in Azure. An experienced BizTalk administrator should have no problem reproducing this test based on the descriptions and pictures. If you need assistance, view the How to reproduce this test section below, which explains everything step by step.


            Figure 1: SlowlyRunningHost in BizTalk Administration Console

            To make the host run slowly, we need to alter Resource-Based Throttling settings. To read and modify these settings, right-click yourBizTalk Group in the Administration Console, choose Settings... and thenHosts. Select the SlowlyRunningHost in the dropdown. The "i" icon to the right indicates the value has been changed. For a thorough explanation of all settings, read this article.

            Resource-Based Throttling - Configuration Changes

            • Threads: Maximum number of messaging engine threads per CPU. Default value is0, meaning no threshold
            • In-process messages: Maximum number of in-memory in-flight messages allowed before throttling message delivery begins. Default value is1000
            • Internal message queue size: Size of the in-memory queue. This queue serves as a temporary placeholder for delivering messages. Default value is100
            • Message count in DB: Maximum number of items in the database. Default value is50000
            • Severity - Inflight message: Controls the reaction time of throttling when the in-process size exceeds the threshold. Default value is75%

            Figure 2: Resouce-Based Throttling
            Next, we need to change Rate-Based Throttling settings for the host.

            Rate-Based Throttling - Configuration Changes

            • Publishing
              • Minimum number of samples: The number of samples used to determine the rate of message publishing by the service classes of the host. Default value is100
              • Sampling window duration: Time-window beyond which samples will not be considered. Default value is15s
              • Rate overdrive factor: Percentage factor by which the system will overdrive the input rate. Default value is125%
              • Maximum throttling delay: The maximum delay imposed for message publishing throttling. Default value is300s
              • Throttling override: Can be used to override message publishing throttling. Default value isDo Not Override
            • Delivery
              • Minimum number of samples: The number of samples used to determine the rate of message delivery by the service classes of the host. Default value is100
              • Sampling window duration: Time-window beyond which samples will not be considered. Default value is15s
              • Rate overdrive factor: Percentage factor by which the system will overdrive the input rate. Default value is125%
              • Maximum throttling delay: The maximum delay imposed for message delivery throttling. Default value is300s
              • Throttling override: Can be used to override message delivery throttling. Default value isDo Not Override

            Figure 3: Rate-Based Throttling

            Configuration Settings XML-file

            This is the exported XML configuration file which corresponds to the settings explained below. Note that settings not related to the SlowlyRunningHost host have been removed.

            <?xmlversion="1.0"encoding="utf-8"?>
              <ExportedGroup>
              </ExportedGroup>
              <GroupSettings>
              </GroupSettings>
              <HostSettings>
                <HostName="SlowlyRunningHost">
                  <SettingName="AllowMultipleResponses">False</Setting>
                  <SettingName="AuthTrusted">False</Setting>
                  <SettingName="DBQueueSizeThreshold">1000</Setting>
                  <SettingName="DBSessionThreshold">0</Setting>
                  <SettingName="DehydrationBehavior">2</Setting>
                  <SettingName="DeliveryQueueSize">1000</Setting>
                  <SettingName="GlobalMemoryThreshold">0</Setting>
                  <SettingName="HostTracking">False</Setting>
                  <SettingName="InflightMessageThreshold">3</Setting>
                  <SettingName="IsHost32BitOnly">False</Setting>
                  <SettingName="LegacyWhitespace">False</Setting>
                  <SettingName="MessageDeliveryMaximumDelay">10000</Setting>
                  <SettingName="MessageDeliveryOverdriveFactor">125</Setting>
                  <SettingName="MessageDeliverySampleSpaceSize">1</Setting>
                  <SettingName="MessageDeliverySampleSpaceWindow">3000</Setting>
                  <SettingName="MessagePublishMaximumDelay">10000</Setting>
                  <SettingName="MessagePublishOverdriveFactor">100</Setting>
                  <SettingName="MessagePublishSampleSpaceSize">1</Setting>
                  <SettingName="MessagePublishSampleSpaceWindow">30000</Setting>
                  <SettingName="MessagingMaxReceiveInterval">500</Setting>
                  <SettingName="MessagingReqRespTTL">20</Setting>
                  <SettingName="MsgAgentPerfCounterServiceClassID">0</Setting>
                  <SettingName="ProcessMemoryThreshold">25</Setting>
                  <SettingName="SubscriptionPauseAt">0</Setting>
                  <SettingName="SubscriptionResumeAt">0</Setting>
                  <SettingName="ThreadPoolSize">20</Setting>
                  <SettingName="ThreadThreshold">3</Setting>
                  <SettingName="ThrottlingBatchMemoryThresholdPercent">1</Setting>
                  <SettingName="ThrottlingDeliveryOverride">1</Setting>
                  <SettingName="ThrottlingDeliveryOverrideSeverity">100</Setting>
                  <SettingName="ThrottlingLimitToTriggerGC">80</Setting>
                  <SettingName="ThrottlingPublishOverride">1</Setting>
                  <SettingName="ThrottlingPublishOverrideSeverity">100</Setting>
                  <SettingName="ThrottlingSeverityDatabaseSize">1</Setting>
                  <SettingName="ThrottlingSeverityInflightMessage">10</Setting>
                  <SettingName="ThrottlingSeverityProcessMemory">500</Setting>
                  <SettingName="ThrottlingSpoolMultiplier">10</Setting>
                  <SettingName="ThrottlingTrackingDataMultiplier">10</Setting>
                  <SettingName="TimeBasedMaxThreshold">1800</Setting>
                  <SettingName="TimeBasedMinThreshold">1</Setting>
                  <SettingName="UseDefaultAppDomainForIsolatedAdapter">False</Setting>
                  <SettingName="XlangMaxReceiveInterval">500</Setting>
                </Host>
              </HostSettings>
              <HostInstanceSettings>
              </HostInstanceSettings>
            </Settings>

            Important notes

            • This test uses one host for receiving and sending. In a production environment, you should implement a host separation strategy. Read more about this here
            • The values here may need tuning based on your needs and requirements. They may also cause different test results, which vary with different hardware and software configurations. Thorough testing is vital
            • Test results vary between the first and subsequent batch of messages after host instance restart

            How to reproduce this test

            1. Create a BizTalk VM in Azure, or use a different test environment [How?]
              • BizTalk 2013 on Windows Server 2012
              • Use Standard A2 tier
            2. Create a host called SlowlyRunningHost [How?]
            3. Create a host instance using the host from step 2 [How?]
            4. Download the configuration file from the TechNet Gallery, and copy to your BizTalk server
            5. Backup the existing configuration [How?]
            6. Import the configuration file from step 4 [How?]
            7. Create Send and Receive handlers for the new host for the FILE adapter [How?]
            8. Create a new messaging application which moves all files from one folder to another. UseSlowlyRunningHost
            9. Optional: Reduce Batch Size to 1 [How?]
            10. Restart the host instance [How?]

            Analysis

            This section will illustrate how the host processes messages after implementing the tuning explained above. The application is moving 30 XML-files from one folder to another on the local C-drive of the server. The pipelines arePassThruReceive and PassThruTransmit. The file sizes vary between 11KB and 2336KB.
            • When using the standard BizTalkServerApplication host (with default settings), this process completes in a couple of seconds
            • When using the SlowlyRunningHost, this process completes in about 5 minutes

            BizTalk Administration Console

            During the test we can see that BizTalk is processing a small amount of messages at the same time, in this case 2. This is as expected.


            Figure 4: All In-Progress Service Instances

            Performance Monitor

            Running Performance Monitor during the test gives us a lot of information. See screenshot below. Some key observations:

            • In-process message count is 2, and In-process message count threshold is 3, which corresponds to theIn-process messages count setting in BizTalk
            • Message delivery delay (ms) and Message publishing delay (ms) is 10000, which corresponds to theMaximum throttling delay setting in BizTalk
            • Message delivery throttling state is 10, and Message publishing throttling state is 11, which means custom/user override throttling
            • Thread count is 56, and Thread count threshold is 3, which incurs throttling and corresponds to the Threads setting in BizTalk

            Figure 5: Performance Monitor during test

            Performance Analysis of Logs (PAL)

            Running PAL during tests provides a lot of details and graphical overview of important performance counters. A few of them will be used here as examples.

            Message publishing throttling state: This is 11 during the whole test (over override on publishing)
             
            Figure 6: Message publishing throttling state

            Message delivery throttling state: This is 10 during the whole test (over override on delivery)

            Figure 7: Message delivery throttling state

            Message delivery delay (ms): This is 10000 (10 seconds) during the whole test.


            Figure 8: Message delivery delay (ms)

            See Also

            Another important place to find an extensive amount of BizTalk related articles is the TechNet Wiki itself. The best entry point is BizTalk Server Resources on the TechNet Wiki.

            Tags: BizTalk, XML, has code, BizTalk Server, throttling, Has TOC, BizTalk Administration, en-US, has comment, has See Also, has Images, has picture, Kjetil Tonstad

            How To Make BizTalk Process Messages Slowly

            $
            0
            0
            Revision 11 posted to TechNet Articles by Sandro Pereira on 10/6/2015 2:30:21 AM

            Problem

            Normally you want messages in BizTalk to be processed as fast as possible. This is not always the case, especially when BizTalk will deliver messages faster than the receiving system can handle them. I have seen this with systems like IBM ContentManager, which crashes hard when BizTalk pounds it with thousands of messages in short periods. Sometimes you actually want BizTalk to slow down, and process messages at a gentle pace. So what do you do? Develop a custom library in C# to control the load?No!

            Solution

            BizTalk hosts have a wide variety of configuration options, and can be tuned for specific scenarios like low latency. The built-in throttling functionality will kick in when BizTalk cannot handle the load, but this behavior can also be forced. By changing theResource-Based Throttling and Rate-Based Throttling settings, we can force a host to process messages slowly.

            The rest of this article will discuss this configuration file in the TechNet Gallery (SlowlyRunningHost.xml).

            Details

            The XML configuration file contains several settings, which change the default behaviour of a BizTalk host. The host name in this case isSlowlyRunningHost, and the following details and tests are performed on a standard BizTalk VM running in Azure. An experienced BizTalk administrator should have no problem reproducing this test based on the descriptions and pictures. If you need assistance, view the How to reproduce this test section below, which explains everything step by step.

            Figure 1: SlowlyRunningHost in BizTalk Administration Console

            To make the host run slowly, we need to alter Resource-Based Throttling settings. To read and modify these settings, right-click yourBizTalk Group in the Administration Console, choose Settings... and thenHosts. Select the SlowlyRunningHost in the dropdown. The "i" icon to the right indicates the value has been changed. For a thorough explanation of all settings, read this article.

            Resource-Based Throttling - Configuration Changes

            • Threads: Maximum number of messaging engine threads per CPU. Default value is0, meaning no threshold
            • In-process messages: Maximum number of in-memory in-flight messages allowed before throttling message delivery begins. Default value is1000
            • Internal message queue size: Size of the in-memory queue. This queue serves as a temporary placeholder for delivering messages. Default value is100
            • Message count in DB: Maximum number of items in the database. Default value is50000
            • Severity - Inflight message: Controls the reaction time of throttling when the in-process size exceeds the threshold. Default value is75%

            Figure 2: Resouce-Based Throttling
            Next, we need to changeRate-Based Throttling settings for the host.

            Rate-Based Throttling - Configuration Changes

            • Publishing
              • Minimum number of samples: The number of samples used to determine the rate of message publishing by the service classes of the host. Default value is100
              • Sampling window duration: Time-window beyond which samples will not be considered. Default value is15s
              • Rate overdrive factor: Percentage factor by which the system will overdrive the input rate. Default value is125%
              • Maximum throttling delay: The maximum delay imposed for message publishing throttling. Default value is300s
              • Throttling override: Can be used to override message publishing throttling. Default value isDo Not Override
            • Delivery
              • Minimum number of samples: The number of samples used to determine the rate of message delivery by the service classes of the host. Default value is100
              • Sampling window duration: Time-window beyond which samples will not be considered. Default value is15s
              • Rate overdrive factor: Percentage factor by which the system will overdrive the input rate. Default value is125%
              • Maximum throttling delay: The maximum delay imposed for message delivery throttling. Default value is300s
              • Throttling override: Can be used to override message delivery throttling. Default value isDo Not Override

            Figure 3: Rate-Based Throttling

            Configuration Settings XML-file

            This is the exported XML configuration file which corresponds to the settings explained below. Note that settings not related to the SlowlyRunningHost host have been removed.

            <?xmlversion="1.0"encoding="utf-8"?>
              <ExportedGroup>
              </ExportedGroup>
              <GroupSettings>
              </GroupSettings>
              <HostSettings>
                <HostName="SlowlyRunningHost">
                  <SettingName="AllowMultipleResponses">False</Setting>
                  <SettingName="AuthTrusted">False</Setting>
                  <SettingName="DBQueueSizeThreshold">1000</Setting>
                  <SettingName="DBSessionThreshold">0</Setting>
                  <SettingName="DehydrationBehavior">2</Setting>
                  <SettingName="DeliveryQueueSize">1000</Setting>
                  <SettingName="GlobalMemoryThreshold">0</Setting>
                  <SettingName="HostTracking">False</Setting>
                  <SettingName="InflightMessageThreshold">3</Setting>
                  <SettingName="IsHost32BitOnly">False</Setting>
                  <SettingName="LegacyWhitespace">False</Setting>
                  <SettingName="MessageDeliveryMaximumDelay">10000</Setting>
                  <SettingName="MessageDeliveryOverdriveFactor">125</Setting>
                  <SettingName="MessageDeliverySampleSpaceSize">1</Setting>
                  <SettingName="MessageDeliverySampleSpaceWindow">3000</Setting>
                  <SettingName="MessagePublishMaximumDelay">10000</Setting>
                  <SettingName="MessagePublishOverdriveFactor">100</Setting>
                  <SettingName="MessagePublishSampleSpaceSize">1</Setting>
                  <SettingName="MessagePublishSampleSpaceWindow">30000</Setting>
                  <SettingName="MessagingMaxReceiveInterval">500</Setting>
                  <SettingName="MessagingReqRespTTL">20</Setting>
                  <SettingName="MsgAgentPerfCounterServiceClassID">0</Setting>
                  <SettingName="ProcessMemoryThreshold">25</Setting>
                  <SettingName="SubscriptionPauseAt">0</Setting>
                  <SettingName="SubscriptionResumeAt">0</Setting>
                  <SettingName="ThreadPoolSize">20</Setting>
                  <SettingName="ThreadThreshold">3</Setting>
                  <SettingName="ThrottlingBatchMemoryThresholdPercent">1</Setting>
                  <SettingName="ThrottlingDeliveryOverride">1</Setting>
                  <SettingName="ThrottlingDeliveryOverrideSeverity">100</Setting>
                  <SettingName="ThrottlingLimitToTriggerGC">80</Setting>
                  <SettingName="ThrottlingPublishOverride">1</Setting>
                  <SettingName="ThrottlingPublishOverrideSeverity">100</Setting>
                  <SettingName="ThrottlingSeverityDatabaseSize">1</Setting>
                  <SettingName="ThrottlingSeverityInflightMessage">10</Setting>
                  <SettingName="ThrottlingSeverityProcessMemory">500</Setting>
                  <SettingName="ThrottlingSpoolMultiplier">10</Setting>
                  <SettingName="ThrottlingTrackingDataMultiplier">10</Setting>
                  <SettingName="TimeBasedMaxThreshold">1800</Setting>
                  <SettingName="TimeBasedMinThreshold">1</Setting>
                  <SettingName="UseDefaultAppDomainForIsolatedAdapter">False</Setting>
                  <SettingName="XlangMaxReceiveInterval">500</Setting>
                </Host>
              </HostSettings>
              <HostInstanceSettings>
              </HostInstanceSettings>
            </Settings>

            Important notes

            • This test uses one host for receiving and sending. In a production environment, you should implement a host separation strategy. Read more about this here
            • The values here may need tuning based on your needs and requirements. They may also cause different test results, which vary with different hardware and software configurations. Thorough testing is vital
            • Test results vary between the first and subsequent batch of messages after host instance restart

            How to reproduce this test

            1. Create a BizTalk VM in Azure, or use a different test environment [How?]
              • BizTalk 2013 on Windows Server 2012
              • Use Standard A2 tier
            2. Create a host called SlowlyRunningHost [How?]
            3. Create a host instance using the host from step 2 [How?]
            4. Download the configuration file from the TechNet Gallery, and copy to your BizTalk server
            5. Backup the existing configuration [How?]
            6. Import the configuration file from step 4 [How?]
            7. Create Send and Receive handlers for the new host for the FILE adapter [How?]
            8. Create a new messaging application which moves all files from one folder to another. UseSlowlyRunningHost
            9. Optional: Reduce Batch Size to 1 [How?]
            10. Restart the host instance [How?]

            Analysis

            This section will illustrate how the host processes messages after implementing the tuning explained above. The application is moving 30 XML-files from one folder to another on the local C-drive of the server. The pipelines arePassThruReceive and PassThruTransmit. The file sizes vary between 11KB and 2336KB.
            • When using the standard BizTalkServerApplication host (with default settings), this process completes in a couple of seconds
            • When using the SlowlyRunningHost, this process completes in about 5 minutes

            BizTalk Administration Console

            During the test we can see that BizTalk is processing a small amount of messages at the same time, in this case 2. This is as expected.

            Figure 4: All In-Progress Service Instances

            Performance Monitor

            Running Performance Monitor during the test gives us a lot of information. See screenshot below. Some key observations:

            • In-process message count is 2, and In-process message count threshold is 3, which corresponds to theIn-process messages count setting in BizTalk
            • Message delivery delay (ms) and Message publishing delay (ms) is 10000, which corresponds to theMaximum throttling delay setting in BizTalk
            • Message delivery throttling state is 10, and Message publishing throttling state is 11, which means custom/user override throttling
            • Thread count is 56, and Thread count threshold is 3, which incurs throttling and corresponds to the Threads setting in BizTalk

            Figure 5: Performance Monitor during test

            Performance Analysis of Logs (PAL)

            Running PAL during tests provides a lot of details and graphical overview of important performance counters. A few of them will be used here as examples.

            Message publishing throttling state: This is 11 during the whole test (over override on publishing)
             

            Figure 6: Message publishing throttling state

            Message delivery throttling state: This is 10 during the whole test (over override on delivery)

            Figure 7: Message delivery throttling state

            Message delivery delay (ms): This is 10000 (10 seconds) during the whole test.

            Figure 8: Message delivery delay (ms)

            See Also

            Another important place to find an extensive amount of BizTalk related articles is the TechNet Wiki itself. The best entry point is BizTalk Server Resources on the TechNet Wiki.

            Tags: BizTalk, XML, has code, BizTalk Server, throttling, Has TOC, BizTalk Administration, en-US, has comment, has See Also, has Images, has picture, Kjetil Tonstad

            How To Make BizTalk Process Messages Slowly

            $
            0
            0
            Revision 12 posted to TechNet Articles by Sandro Pereira on 1/16/2016 4:59:57 PM

            Problem

            Normally you want messages in BizTalk to be processed as fast as possible. This is not always the case, especially when BizTalk will deliver messages faster than the receiving system can handle them. I have seen this with systems like IBM ContentManager, which crashes hard when BizTalk pounds it with thousands of messages in short periods. Sometimes you actually want BizTalk to slow down, and process messages at a gentle pace. So what do you do? Develop a custom library in C# to control the load?No!

            Solution

            BizTalk hosts have a wide variety of configuration options, and can be tuned for specific scenarios like low latency. The built-in throttling functionality will kick in when BizTalk cannot handle the load, but this behavior can also be forced. By changing theResource-Based Throttling and Rate-Based Throttling settings, we can force a host to process messages slowly.

            The rest of this article will discuss this configuration file in the TechNet Gallery (SlowlyRunningHost.xml).

            Details

            The XML configuration file contains several settings, which change the default behaviour of a BizTalk host. The host name in this case isSlowlyRunningHost, and the following details and tests are performed on a standard BizTalk VM running in Azure. An experienced BizTalk administrator should have no problem reproducing this test based on the descriptions and pictures. If you need assistance, view the How to reproduce this test section below, which explains everything step by step.

            Figure 1: SlowlyRunningHost in BizTalk Administration Console

            To make the host run slowly, we need to alter Resource-Based Throttling settings. To read and modify these settings, right-click yourBizTalk Group in the Administration Console, choose Settings... and thenHosts. Select the SlowlyRunningHost in the dropdown. The "i" icon to the right indicates the value has been changed. For a thorough explanation of all settings, read this article.

            Resource-Based Throttling - Configuration Changes

            • Threads: Maximum number of messaging engine threads per CPU. Default value is0, meaning no threshold
            • In-process messages: Maximum number of in-memory in-flight messages allowed before throttling message delivery begins. Default value is1000
            • Internal message queue size: Size of the in-memory queue. This queue serves as a temporary placeholder for delivering messages. Default value is100
            • Message count in DB: Maximum number of items in the database. Default value is50000
            • Severity - Inflight message: Controls the reaction time of throttling when the in-process size exceeds the threshold. Default value is75%

            Figure 2: Resouce-Based Throttling
            Next, we need to changeRate-Based Throttling settings for the host.

            Rate-Based Throttling - Configuration Changes

            • Publishing
              • Minimum number of samples: The number of samples used to determine the rate of message publishing by the service classes of the host. Default value is100
              • Sampling window duration: Time-window beyond which samples will not be considered. Default value is15s
              • Rate overdrive factor: Percentage factor by which the system will overdrive the input rate. Default value is125%
              • Maximum throttling delay: The maximum delay imposed for message publishing throttling. Default value is300s
              • Throttling override: Can be used to override message publishing throttling. Default value isDo Not Override
            • Delivery
              • Minimum number of samples: The number of samples used to determine the rate of message delivery by the service classes of the host. Default value is100
              • Sampling window duration: Time-window beyond which samples will not be considered. Default value is15s
              • Rate overdrive factor: Percentage factor by which the system will overdrive the input rate. Default value is125%
              • Maximum throttling delay: The maximum delay imposed for message delivery throttling. Default value is300s
              • Throttling override: Can be used to override message delivery throttling. Default value isDo Not Override

            Figure 3: Rate-Based Throttling

            Configuration Settings XML-file

            This is the exported XML configuration file which corresponds to the settings explained below. Note that settings not related to the SlowlyRunningHost host have been removed.

            <?xmlversion="1.0"encoding="utf-8"?>
              <ExportedGroup>
              </ExportedGroup>
              <GroupSettings>
              </GroupSettings>
              <HostSettings>
                <HostName="SlowlyRunningHost">
                  <SettingName="AllowMultipleResponses">False</Setting>
                  <SettingName="AuthTrusted">False</Setting>
                  <SettingName="DBQueueSizeThreshold">1000</Setting>
                  <SettingName="DBSessionThreshold">0</Setting>
                  <SettingName="DehydrationBehavior">2</Setting>
                  <SettingName="DeliveryQueueSize">1000</Setting>
                  <SettingName="GlobalMemoryThreshold">0</Setting>
                  <SettingName="HostTracking">False</Setting>
                  <SettingName="InflightMessageThreshold">3</Setting>
                  <SettingName="IsHost32BitOnly">False</Setting>
                  <SettingName="LegacyWhitespace">False</Setting>
                  <SettingName="MessageDeliveryMaximumDelay">10000</Setting>
                  <SettingName="MessageDeliveryOverdriveFactor">125</Setting>
                  <SettingName="MessageDeliverySampleSpaceSize">1</Setting>
                  <SettingName="MessageDeliverySampleSpaceWindow">3000</Setting>
                  <SettingName="MessagePublishMaximumDelay">10000</Setting>
                  <SettingName="MessagePublishOverdriveFactor">100</Setting>
                  <SettingName="MessagePublishSampleSpaceSize">1</Setting>
                  <SettingName="MessagePublishSampleSpaceWindow">30000</Setting>
                  <SettingName="MessagingMaxReceiveInterval">500</Setting>
                  <SettingName="MessagingReqRespTTL">20</Setting>
                  <SettingName="MsgAgentPerfCounterServiceClassID">0</Setting>
                  <SettingName="ProcessMemoryThreshold">25</Setting>
                  <SettingName="SubscriptionPauseAt">0</Setting>
                  <SettingName="SubscriptionResumeAt">0</Setting>
                  <SettingName="ThreadPoolSize">20</Setting>
                  <SettingName="ThreadThreshold">3</Setting>
                  <SettingName="ThrottlingBatchMemoryThresholdPercent">1</Setting>
                  <SettingName="ThrottlingDeliveryOverride">1</Setting>
                  <SettingName="ThrottlingDeliveryOverrideSeverity">100</Setting>
                  <SettingName="ThrottlingLimitToTriggerGC">80</Setting>
                  <SettingName="ThrottlingPublishOverride">1</Setting>
                  <SettingName="ThrottlingPublishOverrideSeverity">100</Setting>
                  <SettingName="ThrottlingSeverityDatabaseSize">1</Setting>
                  <SettingName="ThrottlingSeverityInflightMessage">10</Setting>
                  <SettingName="ThrottlingSeverityProcessMemory">500</Setting>
                  <SettingName="ThrottlingSpoolMultiplier">10</Setting>
                  <SettingName="ThrottlingTrackingDataMultiplier">10</Setting>
                  <SettingName="TimeBasedMaxThreshold">1800</Setting>
                  <SettingName="TimeBasedMinThreshold">1</Setting>
                  <SettingName="UseDefaultAppDomainForIsolatedAdapter">False</Setting>
                  <SettingName="XlangMaxReceiveInterval">500</Setting>
                </Host>
              </HostSettings>
              <HostInstanceSettings>
              </HostInstanceSettings>
            </Settings>

            Important notes

            • This test uses one host for receiving and sending. In a production environment, you should implement a host separation strategy. Read more about this here
            • The values here may need tuning based on your needs and requirements. They may also cause different test results, which vary with different hardware and software configurations. Thorough testing is vital
            • Test results vary between the first and subsequent batch of messages after host instance restart

            How to reproduce this test

            1. Create a BizTalk VM in Azure, or use a different test environment [How?]
              • BizTalk 2013 on Windows Server 2012
              • Use Standard A2 tier
            2. Create a host called SlowlyRunningHost [How?]
            3. Create a host instance using the host from step 2 [How?]
            4. Download the configuration file from the TechNet Gallery, and copy to your BizTalk server
            5. Backup the existing configuration [How?]
            6. Import the configuration file from step 4 [How?]
            7. Create Send and Receive handlers for the new host for the FILE adapter [How?]
            8. Create a new messaging application which moves all files from one folder to another. UseSlowlyRunningHost
            9. Optional: Reduce Batch Size to 1 [How?]
            10. Restart the host instance [How?]

            Analysis

            This section will illustrate how the host processes messages after implementing the tuning explained above. The application is moving 30 XML-files from one folder to another on the local C-drive of the server. The pipelines arePassThruReceive and PassThruTransmit. The file sizes vary between 11KB and 2336KB.
            • When using the standard BizTalkServerApplication host (with default settings), this process completes in a couple of seconds
            • When using the SlowlyRunningHost, this process completes in about 5 minutes

            BizTalk Administration Console

            During the test we can see that BizTalk is processing a small amount of messages at the same time, in this case 2. This is as expected.

            Figure 4: All In-Progress Service Instances

            Performance Monitor

            Running Performance Monitor during the test gives us a lot of information. See screenshot below. Some key observations:

            • In-process message count is 2, and In-process message count threshold is 3, which corresponds to theIn-process messages count setting in BizTalk
            • Message delivery delay (ms) and Message publishing delay (ms) is 10000, which corresponds to theMaximum throttling delay setting in BizTalk
            • Message delivery throttling state is 10, and Message publishing throttling state is 11, which means custom/user override throttling
            • Thread count is 56, and Thread count threshold is 3, which incurs throttling and corresponds to the Threads setting in BizTalk

            Figure 5: Performance Monitor during test

            Performance Analysis of Logs (PAL)

            Running PAL during tests provides a lot of details and graphical overview of important performance counters. A few of them will be used here as examples.

            Message publishing throttling state: This is 11 during the whole test (over override on publishing)
             

            Figure 6: Message publishing throttling state

            Message delivery throttling state: This is 10 during the whole test (over override on delivery)

            Figure 7: Message delivery throttling state

            Message delivery delay (ms): This is 10000 (10 seconds) during the whole test.

            Figure 8: Message delivery delay (ms)

            See Also

            Another important place to find an extensive amount of BizTalk related articles is the TechNet Wiki itself. The best entry point is BizTalk Server Resources on the TechNet Wiki.

            Tags: BizTalk, XML, has code, BizTalk Server, throttling, Has TOC, BizTalk Administration, en-US, has comment, has See Also, has Images, has picture, magazine article, Kjetil Tonstad

            How To Make BizTalk Process Messages Slowly

            $
            0
            0
            Revision 13 posted to TechNet Articles by Richard Mueller on 1/20/2016 10:37:25 AM

            Problem

            Normally you want messages in BizTalk to be processed as fast as possible. This is not always the case, especially when BizTalk will deliver messages faster than the receiving system can handle them. I have seen this with systems like IBM ContentManager, which crashes hard when BizTalk pounds it with thousands of messages in short periods. Sometimes you actually want BizTalk to slow down, and process messages at a gentle pace. So what do you do? Develop a custom library in C# to control the load?No!

            Solution

            BizTalk hosts have a wide variety of configuration options, and can be tuned for specific scenarios like low latency. The built-in throttling functionality will kick in when BizTalk cannot handle the load, but this behavior can also be forced. By changing theResource-Based Throttling and Rate-Based Throttling settings, we can force a host to process messages slowly.

            The rest of this article will discuss this configuration file in the TechNet Gallery (SlowlyRunningHost.xml).

            Details

            The XML configuration file contains several settings, which change the default behaviour of a BizTalk host. The host name in this case isSlowlyRunningHost, and the following details and tests are performed on a standard BizTalk VM running in Azure. An experienced BizTalk administrator should have no problem reproducing this test based on the descriptions and pictures. If you need assistance, view the How to reproduce this test section below, which explains everything step by step.

            Figure 1: SlowlyRunningHost in BizTalk Administration Console

            To make the host run slowly, we need to alter Resource-Based Throttling settings. To read and modify these settings, right-click yourBizTalk Group in the Administration Console, choose Settings... and thenHosts. Select the SlowlyRunningHost in the dropdown. The "i" icon to the right indicates the value has been changed. For a thorough explanation of all settings, read this article.

            Resource-Based Throttling - Configuration Changes

            • Threads: Maximum number of messaging engine threads per CPU. Default value is0, meaning no threshold
            • In-process messages: Maximum number of in-memory in-flight messages allowed before throttling message delivery begins. Default value is1000
            • Internal message queue size: Size of the in-memory queue. This queue serves as a temporary placeholder for delivering messages. Default value is100
            • Message count in DB: Maximum number of items in the database. Default value is50000
            • Severity - Inflight message: Controls the reaction time of throttling when the in-process size exceeds the threshold. Default value is75%

            Figure 2: Resouce-Based Throttling
            Next, we need to changeRate-Based Throttling settings for the host.

            Rate-Based Throttling - Configuration Changes

            • Publishing
              • Minimum number of samples: The number of samples used to determine the rate of message publishing by the service classes of the host. Default value is100
              • Sampling window duration: Time-window beyond which samples will not be considered. Default value is15s
              • Rate overdrive factor: Percentage factor by which the system will overdrive the input rate. Default value is125%
              • Maximum throttling delay: The maximum delay imposed for message publishing throttling. Default value is300s
              • Throttling override: Can be used to override message publishing throttling. Default value isDo Not Override
            • Delivery
              • Minimum number of samples: The number of samples used to determine the rate of message delivery by the service classes of the host. Default value is100
              • Sampling window duration: Time-window beyond which samples will not be considered. Default value is15s
              • Rate overdrive factor: Percentage factor by which the system will overdrive the input rate. Default value is125%
              • Maximum throttling delay: The maximum delay imposed for message delivery throttling. Default value is300s
              • Throttling override: Can be used to override message delivery throttling. Default value isDo Not Override

            Figure 3: Rate-Based Throttling

            Configuration Settings XML-file

            This is the exported XML configuration file which corresponds to the settings explained below. Note that settings not related to the SlowlyRunningHost host have been removed.

            <?xmlversion="1.0"encoding="utf-8"?>
              <ExportedGroup>
              </ExportedGroup>
              <GroupSettings>
              </GroupSettings>
              <HostSettings>
                <HostName="SlowlyRunningHost">
                  <SettingName="AllowMultipleResponses">False</Setting>
                  <SettingName="AuthTrusted">False</Setting>
                  <SettingName="DBQueueSizeThreshold">1000</Setting>
                  <SettingName="DBSessionThreshold">0</Setting>
                  <SettingName="DehydrationBehavior">2</Setting>
                  <SettingName="DeliveryQueueSize">1000</Setting>
                  <SettingName="GlobalMemoryThreshold">0</Setting>
                  <SettingName="HostTracking">False</Setting>
                  <SettingName="InflightMessageThreshold">3</Setting>
                  <SettingName="IsHost32BitOnly">False</Setting>
                  <SettingName="LegacyWhitespace">False</Setting>
                  <SettingName="MessageDeliveryMaximumDelay">10000</Setting>
                  <SettingName="MessageDeliveryOverdriveFactor">125</Setting>
                  <SettingName="MessageDeliverySampleSpaceSize">1</Setting>
                  <SettingName="MessageDeliverySampleSpaceWindow">3000</Setting>
                  <SettingName="MessagePublishMaximumDelay">10000</Setting>
                  <SettingName="MessagePublishOverdriveFactor">100</Setting>
                  <SettingName="MessagePublishSampleSpaceSize">1</Setting>
                  <SettingName="MessagePublishSampleSpaceWindow">30000</Setting>
                  <SettingName="MessagingMaxReceiveInterval">500</Setting>
                  <SettingName="MessagingReqRespTTL">20</Setting>
                  <SettingName="MsgAgentPerfCounterServiceClassID">0</Setting>
                  <SettingName="ProcessMemoryThreshold">25</Setting>
                  <SettingName="SubscriptionPauseAt">0</Setting>
                  <SettingName="SubscriptionResumeAt">0</Setting>
                  <SettingName="ThreadPoolSize">20</Setting>
                  <SettingName="ThreadThreshold">3</Setting>
                  <SettingName="ThrottlingBatchMemoryThresholdPercent">1</Setting>
                  <SettingName="ThrottlingDeliveryOverride">1</Setting>
                  <SettingName="ThrottlingDeliveryOverrideSeverity">100</Setting>
                  <SettingName="ThrottlingLimitToTriggerGC">80</Setting>
                  <SettingName="ThrottlingPublishOverride">1</Setting>
                  <SettingName="ThrottlingPublishOverrideSeverity">100</Setting>
                  <SettingName="ThrottlingSeverityDatabaseSize">1</Setting>
                  <SettingName="ThrottlingSeverityInflightMessage">10</Setting>
                  <SettingName="ThrottlingSeverityProcessMemory">500</Setting>
                  <SettingName="ThrottlingSpoolMultiplier">10</Setting>
                  <SettingName="ThrottlingTrackingDataMultiplier">10</Setting>
                  <SettingName="TimeBasedMaxThreshold">1800</Setting>
                  <SettingName="TimeBasedMinThreshold">1</Setting>
                  <SettingName="UseDefaultAppDomainForIsolatedAdapter">False</Setting>
                  <SettingName="XlangMaxReceiveInterval">500</Setting>
                </Host>
              </HostSettings>
              <HostInstanceSettings>
              </HostInstanceSettings>
            </Settings>

            Important notes

            • This test uses one host for receiving and sending. In a production environment, you should implement a host separation strategy. Read more about this here
            • The values here may need tuning based on your needs and requirements. They may also cause different test results, which vary with different hardware and software configurations. Thorough testing is vital
            • Test results vary between the first and subsequent batch of messages after host instance restart

            How to reproduce this test

            1. Create a BizTalk VM in Azure, or use a different test environment [How?]
              • BizTalk 2013 on Windows Server 2012
              • Use Standard A2 tier
            2. Create a host called SlowlyRunningHost [How?]
            3. Create a host instance using the host from step 2 [How?]
            4. Download the configuration file from the TechNet Gallery, and copy to your BizTalk server
            5. Backup the existing configuration [How?]
            6. Import the configuration file from step 4 [How?]
            7. Create Send and Receive handlers for the new host for the FILE adapter [How?]
            8. Create a new messaging application which moves all files from one folder to another. UseSlowlyRunningHost
            9. Optional: Reduce Batch Size to 1 [How?]
            10. Restart the host instance [How?]

            Analysis

            This section will illustrate how the host processes messages after implementing the tuning explained above. The application is moving 30 XML-files from one folder to another on the local C-drive of the server. The pipelines arePassThruReceive and PassThruTransmit. The file sizes vary between 11KB and 2336KB.
            • When using the standard BizTalkServerApplication host (with default settings), this process completes in a couple of seconds
            • When using the SlowlyRunningHost, this process completes in about 5 minutes

            BizTalk Administration Console

            During the test we can see that BizTalk is processing a small amount of messages at the same time, in this case 2. This is as expected.

            Figure 4: All In-Progress Service Instances

            Performance Monitor

            Running Performance Monitor during the test gives us a lot of information. See screenshot below. Some key observations:

            • In-process message count is 2, and In-process message count threshold is 3, which corresponds to theIn-process messages count setting in BizTalk
            • Message delivery delay (ms) and Message publishing delay (ms) is 10000, which corresponds to theMaximum throttling delay setting in BizTalk
            • Message delivery throttling state is 10, and Message publishing throttling state is 11, which means custom/user override throttling
            • Thread count is 56, and Thread count threshold is 3, which incurs throttling and corresponds to the Threads setting in BizTalk

            Figure 5: Performance Monitor during test

            Performance Analysis of Logs (PAL)

            Running PAL during tests provides a lot of details and graphical overview of important performance counters. A few of them will be used here as examples.

            Message publishing throttling state: This is 11 during the whole test (over override on publishing)
             

            Figure 6: Message publishing throttling state

            Message delivery throttling state: This is 10 during the whole test (over override on delivery)

            Figure 7: Message delivery throttling state

            Message delivery delay (ms): This is 10000 (10 seconds) during the whole test.

            Figure 8: Message delivery delay (ms)

            See Also

            Another important place to find an extensive amount of BizTalk related articles is the TechNet Wiki itself. The best entry point is BizTalk Server Resources on the TechNet Wiki.

            Tags: BizTalk, XML, has code, BizTalk Server, throttling, has image, Has TOC, BizTalk Administration, en-US, has comment, has See Also, has picture, magazine article, Kjetil Tonstad

            How To Make BizTalk Process Messages Slowly

            $
            0
            0
            Revision 14 posted to TechNet Articles by Steef-Jan Wiggers on 1/21/2016 12:39:10 AM

            Problem

            Normally you want messages in BizTalk to be processed as fast as possible. However, this is not always the case, especially when BizTalk delivers messages faster than the receiving system can handle. I have seen this behaviour with systems like IBM ContentManager, which crashes hard when BizTalk pounds it with thousands of messages in short periods. Sometimes you actually like BizTalk to slow down, and process messages at a more moderate pace. So what do you do? Develop a custom library in C# to control the load?No!

            Solution

            BizTalk hosts have a wide variety of configuration options, and can be tuned for specific scenarios like low latency. The built-in throttling functionality will kick in when BizTalk cannot handle the load, but this behavior can also be forced. By changing theResource-Based Throttling and Rate-Based Throttling settings, we can force a host to process messages slowly.

            The rest of this article will discuss this configuration file in the TechNet Gallery (SlowlyRunningHost.xml).

            Details

            The XML configuration file contains several settings, which change the default behaviour of a BizTalk host. The host name in this case isSlowlyRunningHost, and the following details and tests are performed on a standard BizTalk VM running in Azure. An experienced BizTalk administrator should have no problem reproducing this test based on the descriptions and pictures. If you need assistance, view the How to reproduce this test section below, which explains everything step by step.

            Figure 1: SlowlyRunningHost in BizTalk Administration Console

            To make the host run slowly, we need to alter Resource-Based Throttling settings. To read and modify these settings, right-click yourBizTalk Group in the Administration Console, choose Settings... and thenHosts. Select the SlowlyRunningHost in the dropdown. The "i" icon to the right indicates the value has been changed. For a thorough explanation of all settings, read this article.

            Resource-Based Throttling - Configuration Changes

            • Threads: Maximum number of messaging engine threads per CPU. Default value is0, meaning no threshold
            • In-process messages: Maximum number of in-memory in-flight messages allowed before throttling message delivery begins. Default value is1000
            • Internal message queue size: Size of the in-memory queue. This queue serves as a temporary placeholder for delivering messages. Default value is100
            • Message count in DB: Maximum number of items in the database. Default value is50000
            • Severity - Inflight message: Controls the reaction time of throttling when the in-process size exceeds the threshold. Default value is75%

            Figure 2: Resouce-Based Throttling
            Next, we need to changeRate-Based Throttling settings for the host.

            Rate-Based Throttling - Configuration Changes

            • Publishing
              • Minimum number of samples: The number of samples used to determine the rate of message publishing by the service classes of the host. Default value is100
              • Sampling window duration: Time-window beyond which samples will not be considered. Default value is15s
              • Rate overdrive factor: Percentage factor by which the system will overdrive the input rate. Default value is125%
              • Maximum throttling delay: The maximum delay imposed for message publishing throttling. Default value is300s
              • Throttling override: Can be used to override message publishing throttling. Default value isDo Not Override
            • Delivery
              • Minimum number of samples: The number of samples used to determine the rate of message delivery by the service classes of the host. Default value is100
              • Sampling window duration: Time-window beyond which samples will not be considered. Default value is15s
              • Rate overdrive factor: Percentage factor by which the system will overdrive the input rate. Default value is125%
              • Maximum throttling delay: The maximum delay imposed for message delivery throttling. Default value is300s
              • Throttling override: Can be used to override message delivery throttling. Default value isDo Not Override

            Figure 3: Rate-Based Throttling

            Configuration Settings XML-file

            This is the exported XML configuration file which corresponds to the settings explained below. Note that settings not related to the SlowlyRunningHost host have been removed.

            <?xmlversion="1.0"encoding="utf-8"?>
              <ExportedGroup>
              </ExportedGroup>
              <GroupSettings>
              </GroupSettings>
              <HostSettings>
                <HostName="SlowlyRunningHost">
                  <SettingName="AllowMultipleResponses">False</Setting>
                  <SettingName="AuthTrusted">False</Setting>
                  <SettingName="DBQueueSizeThreshold">1000</Setting>
                  <SettingName="DBSessionThreshold">0</Setting>
                  <SettingName="DehydrationBehavior">2</Setting>
                  <SettingName="DeliveryQueueSize">1000</Setting>
                  <SettingName="GlobalMemoryThreshold">0</Setting>
                  <SettingName="HostTracking">False</Setting>
                  <SettingName="InflightMessageThreshold">3</Setting>
                  <SettingName="IsHost32BitOnly">False</Setting>
                  <SettingName="LegacyWhitespace">False</Setting>
                  <SettingName="MessageDeliveryMaximumDelay">10000</Setting>
                  <SettingName="MessageDeliveryOverdriveFactor">125</Setting>
                  <SettingName="MessageDeliverySampleSpaceSize">1</Setting>
                  <SettingName="MessageDeliverySampleSpaceWindow">3000</Setting>
                  <SettingName="MessagePublishMaximumDelay">10000</Setting>
                  <SettingName="MessagePublishOverdriveFactor">100</Setting>
                  <SettingName="MessagePublishSampleSpaceSize">1</Setting>
                  <SettingName="MessagePublishSampleSpaceWindow">30000</Setting>
                  <SettingName="MessagingMaxReceiveInterval">500</Setting>
                  <SettingName="MessagingReqRespTTL">20</Setting>
                  <SettingName="MsgAgentPerfCounterServiceClassID">0</Setting>
                  <SettingName="ProcessMemoryThreshold">25</Setting>
                  <SettingName="SubscriptionPauseAt">0</Setting>
                  <SettingName="SubscriptionResumeAt">0</Setting>
                  <SettingName="ThreadPoolSize">20</Setting>
                  <SettingName="ThreadThreshold">3</Setting>
                  <SettingName="ThrottlingBatchMemoryThresholdPercent">1</Setting>
                  <SettingName="ThrottlingDeliveryOverride">1</Setting>
                  <SettingName="ThrottlingDeliveryOverrideSeverity">100</Setting>
                  <SettingName="ThrottlingLimitToTriggerGC">80</Setting>
                  <SettingName="ThrottlingPublishOverride">1</Setting>
                  <SettingName="ThrottlingPublishOverrideSeverity">100</Setting>
                  <SettingName="ThrottlingSeverityDatabaseSize">1</Setting>
                  <SettingName="ThrottlingSeverityInflightMessage">10</Setting>
                  <SettingName="ThrottlingSeverityProcessMemory">500</Setting>
                  <SettingName="ThrottlingSpoolMultiplier">10</Setting>
                  <SettingName="ThrottlingTrackingDataMultiplier">10</Setting>
                  <SettingName="TimeBasedMaxThreshold">1800</Setting>
                  <SettingName="TimeBasedMinThreshold">1</Setting>
                  <SettingName="UseDefaultAppDomainForIsolatedAdapter">False</Setting>
                  <SettingName="XlangMaxReceiveInterval">500</Setting>
                </Host>
              </HostSettings>
              <HostInstanceSettings>
              </HostInstanceSettings>
            </Settings>

            Important notes

            • This test uses one host for receiving and sending. In a production environment, you should implement a host separation strategy. Read more about this here
            • The values here may need tuning based on your needs and requirements. They may also cause different test results, which vary with different hardware and software configurations. Thorough testing is vital
            • Test results vary between the first and subsequent batch of messages after host instance restart

            How to reproduce this test

            1. Create a BizTalk VM in Azure, or use a different test environment [How?]
              • BizTalk 2013 on Windows Server 2012
              • Use Standard A2 tier
            2. Create a host called SlowlyRunningHost [How?]
            3. Create a host instance using the host from step 2 [How?]
            4. Download the configuration file from the TechNet Gallery, and copy to your BizTalk server
            5. Backup the existing configuration [How?]
            6. Import the configuration file from step 4 [How?]
            7. Create Send and Receive handlers for the new host for the FILE adapter [How?]
            8. Create a new messaging application which moves all files from one folder to another. UseSlowlyRunningHost
            9. Optional: Reduce Batch Size to 1 [How?]
            10. Restart the host instance [How?]

            Analysis

            This section will illustrate how the host processes messages after implementing the tuning explained above. The application is moving 30 XML-files from one folder to another on the local C-drive of the server. The pipelines arePassThruReceive and PassThruTransmit. The file sizes vary between 11KB and 2336KB.
            • When using the standard BizTalkServerApplication host (with default settings), this process completes in a couple of seconds
            • When using the SlowlyRunningHost, this process completes in about 5 minutes

            BizTalk Administration Console

            During the test we can see that BizTalk is processing a small amount of messages at the same time, in this case 2. This is as expected.

            Figure 4: All In-Progress Service Instances

            Performance Monitor

            Running Performance Monitor during the test gives us a lot of information. See screenshot below. Some key observations:

            • In-process message count is 2, and In-process message count threshold is 3, which corresponds to theIn-process messages count setting in BizTalk
            • Message delivery delay (ms) and Message publishing delay (ms) is 10000, which corresponds to theMaximum throttling delay setting in BizTalk
            • Message delivery throttling state is 10, and Message publishing throttling state is 11, which means custom/user override throttling
            • Thread count is 56, and Thread count threshold is 3, which incurs throttling and corresponds to the Threads setting in BizTalk

            Figure 5: Performance Monitor during test

            Performance Analysis of Logs (PAL)

            Running PAL during tests provides a lot of details and graphical overview of important performance counters. A few of them will be used here as examples.

            Message publishing throttling state: This is 11 during the whole test (over override on publishing)
             

            Figure 6: Message publishing throttling state

            Message delivery throttling state: This is 10 during the whole test (over override on delivery)

            Figure 7: Message delivery throttling state

            Message delivery delay (ms): This is 10000 (10 seconds) during the whole test.

            Figure 8: Message delivery delay (ms)

            See Also

            Suggested reading following resources:

            Another important place to find an extensive amount of BizTalk related articles is the TechNet Wiki itself. The best entry point is BizTalk Server Resources on the TechNet Wiki.

            Tags: BizTalk, XML, has code, BizTalk Server, throttling, has image, Has TOC, BizTalk Administration, en-US, has comment, has See Also, has picture, magazine article, Kjetil Tonstad

            How To Make BizTalk Process Messages Slowly

            $
            0
            0
            Revision 15 posted to TechNet Articles by Muhammad Ehsan on 3/21/2016 7:07:06 AM

            Problem

            Normally you want messages in BizTalk to be processed as fast as possible. However, this is not always the case, especially when BizTalk delivers messages faster than the receiving system can handle. I have seen this behaviour with systems like IBM ContentManager, which crashes hard when BizTalk pounds it with thousands of messages in short periods. Sometimes you actually like BizTalk to slow down, and process messages at a more moderate pace. So what do you do? Develop a custom library in C# to control the load?No!

            Solution

            BizTalk hosts have a wide variety of configuration options, and can be tuned for specific scenarios like low latency. The built-in throttling functionality will kick in when BizTalk cannot handle the load, but this behavior can also be forced. By changing theResource-Based Throttling and Rate-Based Throttling settings, we can force a host to process messages slowly.

            The rest of this article will discuss this configuration file in the TechNet Gallery (SlowlyRunningHost.xml).

            Details

            The XML configuration file contains several settings, which change the default behaviour of a BizTalk host. The host name in this case isSlowlyRunningHost, and the following details and tests are performed on a standard BizTalk VM running in Azure. An experienced BizTalk administrator should have no problem reproducing this test based on the descriptions and pictures. If you need assistance, view the How to reproduce this test section below, which explains everything step by step.

            Figure 1: SlowlyRunningHost in BizTalk Administration Console

            To make the host run slowly, we need to alter Resource-Based Throttling settings. To read and modify these settings, right-click yourBizTalk Group in the Administration Console, choose Settings... and thenHosts. Select the SlowlyRunningHost in the dropdown. The "i" icon to the right indicates the value has been changed. For a thorough explanation of all settings, read this article.

            Resource-Based Throttling - Configuration Changes

            • Threads: Maximum number of messaging engine threads per CPU. Default value is0, meaning no threshold
            • In-process messages: Maximum number of in-memory in-flight messages allowed before throttling message delivery begins. Default value is1000
            • Internal message queue size: Size of the in-memory queue. This queue serves as a temporary placeholder for delivering messages. Default value is100
            • Message count in DB: Maximum number of items in the database. Default value is50000
            • Severity - Inflight message: Controls the reaction time of throttling when the in-process size exceeds the threshold. Default value is75%

            Figure 2: Resource-Based Throttling
            Next, we need to changeRate-Based Throttling settings for the host.

            Rate-Based Throttling - Configuration Changes

            • Publishing
              • Minimum number of samples: The number of samples used to determine the rate of message publishing by the service classes of the host. Default value is100
              • Sampling window duration: Time-window beyond which samples will not be considered. Default value is15s
              • Rate overdrive factor: Percentage factor by which the system will overdrive the input rate. Default value is125%
              • Maximum throttling delay: The maximum delay imposed for message publishing throttling. Default value is300s
              • Throttling override: Can be used to override message publishing throttling. Default value isDo Not Override
            • Delivery
              • Minimum number of samples: The number of samples used to determine the rate of message delivery by the service classes of the host. Default value is100
              • Sampling window duration: Time-window beyond which samples will not be considered. Default value is15s
              • Rate overdrive factor: Percentage factor by which the system will overdrive the input rate. Default value is125%
              • Maximum throttling delay: The maximum delay imposed for message delivery throttling. Default value is300s
              • Throttling override: Can be used to override message delivery throttling. Default value isDo Not Override

            Figure 3: Rate-Based Throttling

            Configuration Settings XML-file

            This is the exported XML configuration file which corresponds to the settings explained below. Note that settings not related to the SlowlyRunningHost host have been removed.

            <?xmlversion="1.0"encoding="utf-8"?>
              <ExportedGroup>
              </ExportedGroup>
              <GroupSettings>
              </GroupSettings>
              <HostSettings>
                <HostName="SlowlyRunningHost">
                  <SettingName="AllowMultipleResponses">False</Setting>
                  <SettingName="AuthTrusted">False</Setting>
                  <SettingName="DBQueueSizeThreshold">1000</Setting>
                  <SettingName="DBSessionThreshold">0</Setting>
                  <SettingName="DehydrationBehavior">2</Setting>
                  <SettingName="DeliveryQueueSize">1000</Setting>
                  <SettingName="GlobalMemoryThreshold">0</Setting>
                  <SettingName="HostTracking">False</Setting>
                  <SettingName="InflightMessageThreshold">3</Setting>
                  <SettingName="IsHost32BitOnly">False</Setting>
                  <SettingName="LegacyWhitespace">False</Setting>
                  <SettingName="MessageDeliveryMaximumDelay">10000</Setting>
                  <SettingName="MessageDeliveryOverdriveFactor">125</Setting>
                  <SettingName="MessageDeliverySampleSpaceSize">1</Setting>
                  <SettingName="MessageDeliverySampleSpaceWindow">3000</Setting>
                  <SettingName="MessagePublishMaximumDelay">10000</Setting>
                  <SettingName="MessagePublishOverdriveFactor">100</Setting>
                  <SettingName="MessagePublishSampleSpaceSize">1</Setting>
                  <SettingName="MessagePublishSampleSpaceWindow">30000</Setting>
                  <SettingName="MessagingMaxReceiveInterval">500</Setting>
                  <SettingName="MessagingReqRespTTL">20</Setting>
                  <SettingName="MsgAgentPerfCounterServiceClassID">0</Setting>
                  <SettingName="ProcessMemoryThreshold">25</Setting>
                  <SettingName="SubscriptionPauseAt">0</Setting>
                  <SettingName="SubscriptionResumeAt">0</Setting>
                  <SettingName="ThreadPoolSize">20</Setting>
                  <SettingName="ThreadThreshold">3</Setting>
                  <SettingName="ThrottlingBatchMemoryThresholdPercent">1</Setting>
                  <SettingName="ThrottlingDeliveryOverride">1</Setting>
                  <SettingName="ThrottlingDeliveryOverrideSeverity">100</Setting>
                  <SettingName="ThrottlingLimitToTriggerGC">80</Setting>
                  <SettingName="ThrottlingPublishOverride">1</Setting>
                  <SettingName="ThrottlingPublishOverrideSeverity">100</Setting>
                  <SettingName="ThrottlingSeverityDatabaseSize">1</Setting>
                  <SettingName="ThrottlingSeverityInflightMessage">10</Setting>
                  <SettingName="ThrottlingSeverityProcessMemory">500</Setting>
                  <SettingName="ThrottlingSpoolMultiplier">10</Setting>
                  <SettingName="ThrottlingTrackingDataMultiplier">10</Setting>
                  <SettingName="TimeBasedMaxThreshold">1800</Setting>
                  <SettingName="TimeBasedMinThreshold">1</Setting>
                  <SettingName="UseDefaultAppDomainForIsolatedAdapter">False</Setting>
                  <SettingName="XlangMaxReceiveInterval">500</Setting>
                </Host>
              </HostSettings>
              <HostInstanceSettings>
              </HostInstanceSettings>
            </Settings>

            Important notes

            • This test uses one host for receiving and sending. In a production environment, you should implement a host separation strategy. Read more about this here
            • The values here may need tuning based on your needs and requirements. They may also cause different test results, which vary with different hardware and software configurations. Thorough testing is vital
            • Test results vary between the first and subsequent batch of messages after host instance restart

            How to reproduce this test

            1. Create a BizTalk VM in Azure, or use a different test environment [How?]
              • BizTalk 2013 on Windows Server 2012
              • Use Standard A2 tier
            2. Create a host called SlowlyRunningHost [How?]
            3. Create a host instance using the host from step 2 [How?]
            4. Download the configuration file from the TechNet Gallery, and copy to your BizTalk server
            5. Backup the existing configuration [How?]
            6. Import the configuration file from step 4 [How?]
            7. Create Send and Receive handlers for the new host for the FILE adapter [How?]
            8. Create a new messaging application which moves all files from one folder to another. UseSlowlyRunningHost
            9. Optional: Reduce Batch Size to 1 [How?]
            10. Restart the host instance [How?]

            Analysis

            This section will illustrate how the host processes messages after implementing the tuning explained above. The application is moving 30 XML-files from one folder to another on the local C-drive of the server. The pipelines arePassThruReceive and PassThruTransmit. The file sizes vary between 11KB and 2336KB.
            • When using the standard BizTalkServerApplication host (with default settings), this process completes in a couple of seconds
            • When using the SlowlyRunningHost, this process completes in about 5 minutes

            BizTalk Administration Console

            During the test we can see that BizTalk is processing a small amount of messages at the same time, in this case 2. This is as expected.

            Figure 4: All In-Progress Service Instances

            Performance Monitor

            Running Performance Monitor during the test gives us a lot of information. See screenshot below. Some key observations:

            • In-process message count is 2, and In-process message count threshold is 3, which corresponds to theIn-process messages count setting in BizTalk
            • Message delivery delay (ms) and Message publishing delay (ms) is 10000, which corresponds to theMaximum throttling delay setting in BizTalk
            • Message delivery throttling state is 10, and Message publishing throttling state is 11, which means custom/user override throttling
            • Thread count is 56, and Thread count threshold is 3, which incurs throttling and corresponds to the Threads setting in BizTalk

            Figure 5: Performance Monitor during test

            Performance Analysis of Logs (PAL)

            Running PAL during tests provides a lot of details and graphical overview of important performance counters. A few of them will be used here as examples.

            Message publishing throttling state: This is 11 during the whole test (over override on publishing)
             

            Figure 6: Message publishing throttling state

            Message delivery throttling state: This is 10 during the whole test (over override on delivery)

            Figure 7: Message delivery throttling state

            Message delivery delay (ms): This is 10000 (10 seconds) during the whole test.

            Figure 8: Message delivery delay (ms)

            See Also

            Suggested reading following resources:

            Another important place to find an extensive amount of BizTalk related articles is the TechNet Wiki itself. The best entry point is BizTalk Server Resources on the TechNet Wiki.

            Tags: BizTalk, XML, has code, BizTalk Server, throttling, has image, Has TOC, BizTalk Administration, en-US, has comment, has See Also, has picture, magazine article, Kjetil Tonstad
            Viewing all 36 articles
            Browse latest View live