Script to Restart host instance when hung RRS feed

  • Question

  • HI All

    At times during timeout host instances get hung and so we need to restart it manually. Is there any script that will determine if there are more number of Active instances and if so then restart host instances automatically?



    Saturday, September 1, 2018 5:50 PM

All replies

  • Your aproach are not the best

    Find out why the host instance is not processing (probably due to throttling)

    • Do you have errors
    • SQL issues
    • Too few host instances
    • Too many documents at the same time
    • Other issues

    Use BizTalk Health Monitor and performance counters to check for issues on BTS

    Best practice is to distribute by having at least host instance for receiving, processing (orchestration), sending and a dedicated host for tracking

    Check health and performance on the MSSQL, disklatency
    Eg moving pagefile.sys to a dedicated drive can help
    Check memory usage on the server, add more if needed

    EDIIT: Count of active/dehydrated instances using powershell

    $a=Get-WmiObject -Class "MSBTS_ServiceInstance" -Namespace 'root\MicrosoftBizTalkServer' | Where-Object { $_.Item -match "$Name" -and $_.Item -ne "" -and ($_.ServiceStatus -eq "1" -or $_.ServiceStatus -eq "2" -or $_.ServiceStatus -eq "8" ) } | measure
    The host instance can be restarted just like any other service


    When asking a question please be as thoroughly as possible this will make it easier to assist you http://www.catb.org/esr/faqs/smart-questions.html

    Sunday, September 2, 2018 7:47 AM
  • Hi Tim,

    Prevention is better than cure! as Peter suggested different ways to identify the cause of host instance hung.

    Most of the time hosts are getting stuck due in Active or Ready to Run state due to slow response from outbound services(WCF, SQL etc)

    I would suggest to identify such services ports and increase timeout period on port level along with increased retry count.

    Also best practices would be separate the host for inbound(Receive Port), outbound(Send Port) and workflow(Orchestration) processes.


    Hope this Helps!!!! Regards, Note: Please Mark As Answered if you satisfy with Reply.

    Sunday, September 2, 2018 9:48 AM
  • Do you see any warnings when the condition happens?? Does event log register any suspicious events, have you run a BHM analysis on your BizTalk environment to find out if there are issues in the environment?

    Mandar Dharmadhikari

    Monday, September 3, 2018 12:15 AM