Preload BizTalk assemblies on host instance startup RRS feed

  • Question

  • Hi. I want to improve the performance of my BizTalk application when it processes the first message that hits it after startup. Currently there is a delay while the assemblies are loaded the first time; after that, performance is fine.

    I know I can drop a test message in to get BizTalk to "warm up" as it were, but that's not ideal. I have also looked at ngen but would prefer not to go down that route.

    What I want to achieve is, after a server reboot or BizTalk host instance restart BizTalk startups "warm" automatically.

    I got my hopes up when I saw a preLoad element for .Net config files but that seems to apply only to .Net remoting.

    Any suggestions greatfully received!

    Myles Jeffery | Thinkscape | SharePoint Online Deployment | SharePoint Online File Migration Tool
    Wednesday, September 29, 2010 8:48 PM


All replies

  • Hi Myles,

    The orchestration engine uses an XML file called BTSNTSvc.exe.config to determine certain behaviors. For example, dehydration properties and their default values are configured as XML in the BTSNTSvc.exe.config file and are read when all host instances containing an orchestration start. You can change the behaviour to your desire, see Orchestration Engine Configuration. You can also look at BizTalk Optimization on MSDN.



    Steef-Jan Wiggers - MVP & MCTS BizTalk Server
    If this answers your question please mark it accordingly


    Wednesday, September 29, 2010 11:09 PM
  • The behaviour is mainly due to the way .NET works, when you restart your host instance (or server reboot) the AppDomain is freshly loaded. As and when you access various parts of your application the corresponding assemblies (orchestration, maps, schemas etc) gets loaded into the AppDomain and they go through the normal CLR loading process like JIT compilation. The tunnings in the BtsNtSvc.exe.config file will be useful for example extending the life of the AppDomain. I believe the default setting is 4 hours, after which the appDomain gets recycled.   

    If you are using typed objects, you can look into options like sgen.exe (note not ngen) to speed up a bit.

    Regards, Saravana Kumar [MVP BizTalk Server]
    Thursday, September 30, 2010 4:39 AM
  • Thanks for the responses guys. So it looks like it is simply not possible to get the assemblies to force load on startup of BizTalk through say, a simple config only change?


    Myles Jeffery | Thinkscape | SharePoint Online Deployment | SharePoint Online File Migration Tool
    Thursday, September 30, 2010 6:22 AM
  • Hi,

    I also think this is not possible. You can optimize the first load but it cannot be triggered automatically. The only thing you can do is configure the processes/appdomains to stay in memory so you will not have a first load again after some time of not using the system.



    Randal van Splunteren - MVP, MCTS BizTalk Server

    Please mark as answered if this answers your question.

    Check out the PowerShell provider for BizTalk:
    Thursday, September 30, 2010 7:17 AM
  • Another thing to think about is that the BizTalk engine/runtime is loading the assemblies itself. I do not think the assembly loading config options will work because there is no guarantee that the BizTalk engine will use those settings.


    If this answers your question, please use the "Answer" button to say so | Ben Cline
    Thursday, September 30, 2010 4:31 PM
  • Thanks Ben. My alternative now is to look at sending a "warm up" message through BizTalk to get it to load the assemblies. Probably the simplest approach would be to send an XML message through a "warm up" receive location who's schema matches one in the target assembly which would cause BizTalk to load it.

    Myles Jeffery | Thinkscape | SharePoint Online Deployment | SharePoint Online File Migration Tool
    Thursday, September 30, 2010 5:26 PM
  • I don’t think this is the ideal solution for this issue, what you will do if you have 100 different messages with different XML Schemas, will you create a separate warm up messages for each of these 100 schemas. Can anyone let me know a batter solution, as I have the same issue but I have 100 different messages.



    Thursday, April 18, 2013 1:18 PM