Professional Documents
Culture Documents
30 Useful Biztalk Server Tips PDF
30 Useful Biztalk Server Tips PDF
30 Useful Biztalk Server Tips PDF
BIZTALK
SERVER
TIPS
Ricardo Torre
Head of Technical Pre-Sales
& Product Strategist
1
contents Take advantage
of Multi MessageBox
Configuration
2 Efficient
3
BAM
4 Minimize
5
Host lightweight persistence
Separation tracking points
6 7 8
Health
Check
Package with
Choose all your Message
robust Performance resources Box
adapters Testing is key into MSI Viewer
9 Monitor
performance
10 Build your
custom pipelines
11 Create
SLAs with with components using security
BAM default properties boundaries
12 13 14
Use the
Business Rule
Cluster Engine to implement
host Business Logic
Review
15
instances
the with
performance adapter
of your like Split big
environment FTP or messages in the
regularly POP3 receive pipeline
16 Use
17 Use fast
Visual Studio for disks for your
functional and load testing BizTalk Database subsystem
18 Cluster
19 20 Use SSO
the Master Purge as the application
Secret Server BAM Data configuration store
21 Plan
your
22 Use
Webgarden
23 Configure and
Backup and for IIS activate the DTA
DR strategy scalability Purge and Archive Job
24 25 26
Consider
Maintain you to prefer Test 100%
Message Box efficiently XSLT in maps of your code
27 28 Avoid
29
Develop
Orchestrations adapter
when possible using WCF
Imple-
ment a
Enterprise
Service
30
Bus using the Use ETW for high
ESB Toolkit performance tracking
1 Take advantage of
Multi MessageBox Configuration
The single most significant optimization step when dealing with scaling the
BizTalk Message Box is adding new message boxes even when they are creat-
ed in the same SQL Instance, with the added benefit of being the most simple
to implement. You will need to add three message boxes to achieve the best
performance.
When configuring hosts always consider the best practices for host sepa-
ration, start with the separation of artifacts per functionality (receive, send,
orchestration and tracking) then consider isolation (per application, business
unit, etc), then for performance reasons and finally for reliability reasons. A
good Host separation policy will help you scale your environment, ensure sta-
bility and security.
You can also separate hosts for security and reliability reasons, since each host
has its own set of dedicated resources such as database tables and windows
services you can separate artifacts or applications that have high performance
requirements that will benefit from these additional resources. If you have
some unreliable artifact you can also use host separation for reducing the
impact of such component (Custom Adapter, Pipeline, etc.) since if that partic-
ular host instance crashes it won’t affect anything else .
Using BAM to do tracking gives you the opportunity to track exactly what you
need, you can define your tracking schema (activity) and what you map to
be tracked (tracking profile). The BAM Infrastructure also give you the ability
to define your purging and partitioning criteria allowing you to control how
much data you retain and also OLAP cubes can be created to better analyse
the tracking data. Read more on How to replace Tracking with BAM in BizTalk.
Reducing these persistence points will have a significant impact in the overall
performance, you can avoid them all together if you don’t use Orchestrations
in scenarios where you only do receive, transform and send. You can also re-
duce the amount of persistence points within a Orchestration if you for ex-
ample group send shapes inside a atomic scope or use the Call Orchestration
shape instead of the Start Orchestration shape. Read more on this topic here.
Run Message Box Viewer (MBV) daily to evaluate the health state of your Biz-
Talk environment, this tool brings the knowledge of Microsoft Product Group,
Support and Field Engineers into a single report. You can schedule MBV from
either MBV itself or via BizTalk360 to run every day and be notified if any new
critical or noncritical errors surface.
Microsoft recommends that you run Message Box Viewer every day as part of
the daily operational checklist (see: Checklist: Performing Daily Maintenance
Checks) for checking the health of everything that is BizTalk related such as
the databases, configuration, best practices, registry settings, service packs
and cumulative updates, runtime problems, adapter problems, etc. The likeli-
hood of what you want to check to be done by MBV is very high.
The reports generated are also in a big degree a documentation of your Bi-
zTalk environment and can be used to review the BizTalk configuration and
identify message flows within the system. In case problems are identified that
can be solved by the BizTalk Terminator, MBV will generate a configuration file
to load in the BizTalk Terminator and allow you to run the solutions needed
for your BizTalk system.
There is a great white paper from Microsoft “BizTalk Server Performance Op-
timization Guide” which will help you understand various aspects of perfor-
mance tuning, how to use tools like LoadGen, etc.
Include every artifact in your BizTalk Application as a MSI resource for a fully
automated application installation, you can include anything you need includ-
ing script files that are executed during install and uninstall. This will give you
a single installation package with minimal manual intervention which reduces
the likely would of introducing problems.
BAM can be easily used to calculate performance SLAs and provide this infor-
mation to business owners, you can then enable BAM Alerting and use that
for monitoring your performance SLAs. If you also use the BAM API you will
be able to extend this SLA monitoring capability outside the boundaries of
BizTalk.
By defining an activity in BAM that collects at least two milestones you will be
able to calculate the duration between them using a calculated field in BAM.
Once this is done you now have access to the KPI you need to measure and
you can create a query in BAM to identify instances where the duration was
bigger than your defined threshold. You can also use BAM Alerts to receive a
notification every time your query returns new results.
Read more on this topic BAM to Implement Service and SLA Monitoring
Build your custom pipelines with components using their default properties
and then use runtime bindings for adjusting them for multiple purposes. This
will reduce the amount of artifacts you need in your solution and will increase
the code re-usage making it easier to test and deploy.
A very common example of this is the flat file disassembler where you need to
identify the schema to which the flat file being received should be parsed to.
Lock down your BizTalk system by using different security context when ac-
cessing sensitive information, you can achieve this by running your hosts and
host instances with different Windows Groups and Users. Reducing the sur-
face of attack with this approach will make your environment less prone to
attacks.
Security is a very important topic when integrating with highly critical appli-
cations inside and across organizations. Planning and implementing security
is a demanding task. In BizTalk you will have to assign permissions to receive,
send and query against your most important applications giving the BizTalk
environment a considerable amount of power and at the same time risk of
getting compromised.
Collect performance counters on a regular basis and analyse them with PAL
for the best performance insight of a BizTalk environment. Collect perfor-
mance data during your utilization peak time and compare the results with a
baseline to be able to plan for the right capacity in your system.
Monitoring the performance of your BizTalk System is key for a stable and
predictable behaviour. Since the amount of counters available in a BizTalk
System is vast it is hard to know which ones to pay more attention or under-
standing the correlations of their values. This is where PAL will help you by
providing a list of counters recommended to collect and then parses all these
counters and evaluates them based on the knowledge of experienced BizTalk
engineers and generates alerts when thresholds are being violated. A compre-
hensive report is generated after running this tool.
Not only will you benefit from the collective knowledge for BizTalk but also
from other software in the stack such as Windows, IIS, SQL Server and more.
Start using it Performance Analysis of Logs (PAL) Tool.
Use Microsoft Clustering for adapters that required a single host instance run-
ning at a time like FTP or POP3 to avoid duplicate messages while providing
high availability. Failure to implement this will result in either having to deal
with duplicate messages or implementing manual processes for performing
failover.
Use Business Rule Engine to implement business logic that is modular, reus-
able and simple. It will allow you to operate on information contained in .NET
objects, database tables and XML Documents. BRE also enables developers to
create and maintain applications with minimal effort.
The Business Rule Engine can be a good way of to modularize the constantly
changing business logic that is often developed inside Orchestrations, making
changes a more smooth process since updating a policy to the latest version
doesn’t require any downtime at all. With some training even non BizTalk de-
velopers or tech savvy non developers can create and test rules.
If you have a big message consider using envelop schemas and the default
pipelines to split the message at the entrance point in BizTalk for best perfor-
mance and high resource utilization. Using this method also doesn’t require
the creation of custom pipelines or very expensive splitting in the orchestra-
tions.
Use Visual Studio test capabilities for functional testing and load testing, you
can simulate real load of your environment while at the same time monitoring
performance and behavior of your environment during the test in real time.
When load testing start by doing short duration tests first and then long du-
ration reliability tests.
SQL Server is vital for any BizTalk environment, ensure maximum performance
for the most demanding databases with a fast disk subsystem, consider using
RAID 1+0 and SSDs for a high performance environment. In the majority of
the BizTalk environments this is the first physical bottleneck you will face.
When doing load testing you will find that after you configure you environ-
ment to avoid any logical bottlenecks you will finally find a physical one. Nor-
mally the very first physical bottleneck you see is the IO disk subsystem per-
formance on the SQL Server, this makes investing in the disk subsystem the
most important scaling you can do on an environment. Betting on a highly
available RAID system with fast disks is very important.
Cluster SSO Master Secret Server using Windows Clustering to guarantee this
component is also highly available, you have to do this to achieve full HA. The
best candidate servers on which you can cluster the Master Secret Server is
the SQL Server cluster where BizTalk is installed because you can reuse this
cluster for this low weight service.
If you have not clustered the Master Secret Server there is no high availability
in the BizTalk environment, in this cases the first machine you have installed is
the Master Secret Server and if it becomes unavailable the whole BizTalk en-
vironment will not work since it depends on the Master Secret server to read
configuration from the SSO database.
If you want to install the SSO cluster on the BizTalk machines you can only do
it if you also cluster all the hosts in the same Cluster application which means
you will have an active passive BizTalk runtime environment. Read more on
High-Availability SSO Installation Options
Use the out of the box SSIS packages for purging old data from BAM ensuring
only relevant information is available and that the Performance of the BAM-
PrimaryImport is the best. You can create SQL Jobs to run this packages which
are automatically generated when you deploy your BAM Activities.
For BizTalk Application settings use SSO for secure, scalable and highly avail-
able store. This is more secure than the usually used BizTalk configuration file
and is more maintainable since you will have a single place to update your
BizTalk Applications configuration and much more easily you can automate
the deployment of these settings.
Configure and activate the BizTalk Backup Job to generate the only supported
BizTalk backup files and ensure you are able to restore them by planning and
testing a disaster recovery plan. The success criteria for a Disaster Recovery
plan happens only when you test your scenario.
The only supported way of backing up the BizTalk databases is by using the
out of the box Backup BizTalk Server Job combined the BizTalk Log Shipping
for automatic restoration. It is recommended that you plan the recovery of all
BizTalk server components including the databases, configuration and appli-
cations; you should also consider the recovery point objective (RPO) and the
recovery time objective (RTO) when considering about investing in your disas-
ter recovery plan.
When IIS becomes a bottleneck you can use webgarden for IIS scalability, this
will create multiple hosting processes in the server and IIS will manage the
balancing of load between them. Optimizing your web layer like this is very
simple and highly reliable when compared to changing other internal IIS en-
gine settings.
If you have the need to process a large amount of two way receive port con-
nections through IIS in a BizTalk Application it is likely you will exhaust some
threading capabilities in the IIS engine and hit a logical bottleneck, if you have
access to an IIS expert you can possible reconfigure the engine to overcome
that limitation, or instead using the very scalable and easy to use web garden
capability.
Configure and activate the DTA Purge And Archive Job to maintain a healthy
BizTalkDTADb database, just keep the tracking information you need and de-
lete from the live tracking database a soon as possible for the best experience
when searching or understanding what happened to your business processes
in BizTalk.
A big BizTalkDTADb will result in frequent timeouts and a generally bad ex-
perience when working with tracking data in BizTalk, the best way to handle
this problem is by configuring and activating the DTA Purge and Archive Job.
If you do need the tracking information and you need to have a smaller data-
base you can use the archiving capabilities for making older tracking informa-
tion available for querying.
Don’t let your BizTalk Message Box database grow significantly by accumu-
lating suspended messages, put in place a monitoring mechanism to identify
and resolve suspended messages as soon as possible. When you find a data-
base integrity problem that is causing your databases to grow use the BizTalk
Terminator to resolve this.
Maintaining the health of your BizTalk databases is vital for any BizTalk envi-
ronment, specially when we are talking about the BizTalkMsgBoxDb, there are
several reasons for the databases to grow like suspended messages that you
should avoid and resolved quickly when they happen. You can also have some
integrity problems identified by using the out of the box Monitor Job or by
running a tool like the Message Box Viewer, in this cases you can run the Biz-
Talk Terminator which is a tool provided by Microsoft to address these issues.
When developing maps consider using XSLT as the preferred language for
describing your transformations by either using Custom XSLT, Scripting Func-
toids or even when developing Custom Functoids. This will result in maps that
are faster to run and easier to debug.
Using the out of the box functoids is sometimes hard or impossible to imple-
ment the necessary transformations leaving developers a lot of options on
how to overcome those limitations. Using custom XSLT as a full map, a inline
XSLT scripting functoid or developing a functoid that outputs XSLT is in the
majority of the times the best option due to the end result being just on sin-
gle XSLT that needs to be compiled and run just like any other simple map
without any need for external components.
Here is a good place to start working with the ESB Toolkit by reading the
Introduction to the BizTalk ESB Toolkit.
If you want a in-depth video on the ESB Toolkit capabilities watch this video.
Implement a Enterprise
Service Bus using the ESB Toolkit TWEET SHARE POST
28 Avoid Orchestrations
when possible
Use static routing, content based routing or itineraries to avoid using Orches-
trations and use routing of failed messages for advance error handling since
messaging doesn’t provide a rich error handling capability. This approach will
give you the high performance of messaging and the power of the Orchestra-
tions when necessary.
When developing new adapters create a Custom WCF Channel or use the
WCF LOB SDK as a reference starting point, this will allow you to create a scal-
able and easy to host adapter that can be used across other .NET solutions.
This level of flexibility will make the adapter more likely to be reused some-
where else besides the BizTalk world and so being more valuable than simply
building it with the BizTalk Adapter framework.
If you have to decide to implement a BizTalk Adapter you will want to make it
so that it can be as relevant as possible and choosing the framework you will
use is an important task. The simple fact that developing adapters for WCF
makes them reusable should be a compelling enough reason to decide.
You can understand the Differences Between the WCF LOB Adapter SDK and
the BizTalk Server Adapter Framework here.
Use Event Tracking for Windows (ETW) for a high performance tracking and
debugging of your BizTalk Applications. Since this method uses some high
performance structures within Windows to host tracking the impact is near
zero if you are not consuming the output and highly valuable if you are trou-
bleshooting a problem.
Ricardo Torre
Head of Technical Pre-Sales & Product Strategist
www.BizTalk360.com