BizTalk, Debugging

How-to: Find the host that BTSNTSVC.exe belongs to

Often times when you are looking at your environment from a performance perspective – perhaps you are testing or perhaps you are only trying to find out which host is responsible for the process running at 100% for 5 minutes – you need to know which BizTalk process has been started by what host. Another common reason is to know which service to attach to when debugging. There are a couple of ways to know this, and which one is best is both preference and related to environment and scenario. Regardless of scenario I prefer to start as few, quick and small applications as possible. I’ve put what I consider the best options in the order which is my preference.

  1. Use the tasklist command in a command window: tasklist /svc /fi “imagename eq btsntsvc.exe”

  2. View the BizTalk:Messaging ID Process perfomance counter in a command window: typeperf “BizTalk:Messaging(*)ID Process” -sc 1

  3. If you would like a more graphical interface there are tools that wraps the same data up in a prettier format, such as PerfMon and Windows SysInternals Process Monitor.

  4. I’m sure there are several more ways to do this… as I mentioned, it’s a matter or preference.

If you want to add this as an External Tool in Visual Studio to have it easily accessible for when you want to attach a host process to debug you can add it like this:

Of course, you could just always attach to all hosts. If you want to do this or not depends on the number of hosts you have running among other things, but why do so if you don’t need to?