Andreof
Andreof

Reputation: 1

BizTalk Latency increases after 1 minute of initial call

I'm running an orchestration in BizTalk server 2016, with a 2-way WCF Receive Port (IIS), and a SAP adapter Send Port, to run a light query in SAP. I'm trying to optimize performance.

My question is: when I call my Orchestration for the first time (after I restart the Host instance) the first call takes around 1 second which I understand is because it's loading the assemblies into memory. The subsequent calls are much faster and take around 200-300 ms. But, exactly 1 minute after the first call, the next call takes 1 second again. The pattern is:

1st call 1 s
new call 300 ms
new call 300 ms
...
new call 1 s (1 minute after the first call)
new call 300 ms
new call 300 ms
...

It's like something is being cleared from memory after 1 minute but I cannot understand why? I have tweaked the config file so the assemblies never unload from memory and I have the pooling of messages and orchestrations down to 50ms.

Is there any other configuration I need to change?

Upvotes: 0

Views: 348

Answers (2)

Gediminas K Didžioji
Gediminas K Didžioji

Reputation: 61

60 seconds interval seems like BizTalk Cache refresh interval which has this value by default. Although it does not reload assemblies and mostly configuration, it might actually add tinny bits to processing time.
Please see Configuration Cache Refresh Interval

Upvotes: 0

Dan Field
Dan Field

Reputation: 21641

The Orchestration AppDomain tears itself down every once in a while if it's not active.

If you look into the docs here, there are options for configuring how often this happens, specifically this section seems to be what you're looking for:

In this section the user may specify defualt configuration for any app domain created that does not have a named configuration associated with it (see AppDomainSpecs below)

SecondsEmptyBeforeShutdown is the number of seconds that an app domain is empty (that is, it does not contain any orchestrations) before being unloaded. Specify -1 to signal that an app domain should never unload, even when empty.

Similarly, SecondsIdleBeforeShutdown is the number of seconds that an app domain is idle (that is, it contains only dehydratable orchestrations) before being unloaded. Specify -1 to signal that an app domain should never unload when idle but not empty. When an idle but non-empty domain is shut down, all of the contained instances are dehydrated first.

<DefaultSpec SecondsIdleBeforeShutdown="1200" SecondsEmptyBeforeShutdown="1800">

Just be warned that this really should be thoroughly tested (particularly testing it under normal production loads for several hours at a time at least). It may produce other unwanted side effects around memory usage and overall performance. Is 1 second really too high a price to pay every so often in your scenario?

Upvotes: 0

Related Questions