Ricardo Torre
Product Strategist – BizTalk360
Primary
(default file group)
Misc Data Misc Indexes Predicate Data
Predicate
Indexes
Message Data
Message
Indexes
For more information: BizTalk Server MessageBox Database Filegroups SQL Script
2 BizTalk Servers:
• 0.5 Business Transactions / second
• 6.3 seconds avg. latency (5 sec wait time)
4 BizTalk Servers:
• 0.69 Business Transactions / second
• 11.2 seconds avg. latency
BUT…
When a new row is inserted into an index, SQL Server will
use the following algorithm to execute the modification:
1.Record a log entry that row has been modified.
2.Traverse the B-tree to locate the correct page to hold the new record.
3.“Latch” (lock) the page with PAGELATCH_EX, preventing others from modifying it.
4.Add the row to the page and, if needed, mark the page as dirty.
5.“Unlatch” the page
Eventually this can lead to “latch convoys” in highly
concurrent workloads
Session
ID Latch Type Database SchemaObject Name Index Name Wait Type
241
PAGELATCH_E
X
BizTalkMsgBoxD
b dbo Spool IX_Spool 109
273
PAGELATCH_E
X
BizTalkMsgBoxD
b dbo Spool IX_Spool 63
348
PAGELATCH_E
X
BizTalkMsgBoxD
b dbo Spool IX_Spool 63
177
PAGELATCH_E
X
BizTalkMsgBoxD
b dbo Spool IX_Spool 62
302
PAGELATCH_E
X
BizTalkMsgBoxD
b dbo Spool IX_Spool 62
311
PAGELATCH_E
X
BizTalkMsgBoxD
b dbo Spool IX_Spool 62
108
PAGELATCH_E
X
BizTalkMsgBoxD
b dbo Spool IX_Spool 47
110
PAGELATCH_E
X
BizTalkMsgBoxD
b dbo Spool IX_Spool 47
Contention on Small Number of Pages in Heavily Accessed Tables
(Select, Update, Delete, Insert all running concurrently on multiple threads)
High rate of Insert/Select/Update/Delete access patterns against very small tables
We have observed latch contention in MessageBox schema on 16 Cores and above
This problem is now being reported by production deployments, waits 100+ms
Impact:
Latch waits > 50-100ms+
Observed waits on internal SQL Structure
• ACCESS_METHODS_HOBT_VIRTUAL_ROOT
Workaround
Minimize load on MessageBox
• App design to avoid persistence points
• Use inline sends if necessary
Multi-MessageBox may alleviate this problem somewhat
Q & A
Uk user group   biz talk performance deepdive

Uk user group biz talk performance deepdive

  • 1.
  • 17.
    Primary (default file group) MiscData Misc Indexes Predicate Data Predicate Indexes Message Data Message Indexes For more information: BizTalk Server MessageBox Database Filegroups SQL Script
  • 22.
    2 BizTalk Servers: •0.5 Business Transactions / second • 6.3 seconds avg. latency (5 sec wait time) 4 BizTalk Servers: • 0.69 Business Transactions / second • 11.2 seconds avg. latency BUT…
  • 24.
    When a newrow is inserted into an index, SQL Server will use the following algorithm to execute the modification: 1.Record a log entry that row has been modified. 2.Traverse the B-tree to locate the correct page to hold the new record. 3.“Latch” (lock) the page with PAGELATCH_EX, preventing others from modifying it. 4.Add the row to the page and, if needed, mark the page as dirty. 5.“Unlatch” the page Eventually this can lead to “latch convoys” in highly concurrent workloads
  • 25.
    Session ID Latch TypeDatabase SchemaObject Name Index Name Wait Type 241 PAGELATCH_E X BizTalkMsgBoxD b dbo Spool IX_Spool 109 273 PAGELATCH_E X BizTalkMsgBoxD b dbo Spool IX_Spool 63 348 PAGELATCH_E X BizTalkMsgBoxD b dbo Spool IX_Spool 63 177 PAGELATCH_E X BizTalkMsgBoxD b dbo Spool IX_Spool 62 302 PAGELATCH_E X BizTalkMsgBoxD b dbo Spool IX_Spool 62 311 PAGELATCH_E X BizTalkMsgBoxD b dbo Spool IX_Spool 62 108 PAGELATCH_E X BizTalkMsgBoxD b dbo Spool IX_Spool 47 110 PAGELATCH_E X BizTalkMsgBoxD b dbo Spool IX_Spool 47
  • 26.
    Contention on SmallNumber of Pages in Heavily Accessed Tables (Select, Update, Delete, Insert all running concurrently on multiple threads) High rate of Insert/Select/Update/Delete access patterns against very small tables We have observed latch contention in MessageBox schema on 16 Cores and above This problem is now being reported by production deployments, waits 100+ms Impact: Latch waits > 50-100ms+ Observed waits on internal SQL Structure • ACCESS_METHODS_HOBT_VIRTUAL_ROOT Workaround Minimize load on MessageBox • App design to avoid persistence points • Use inline sends if necessary Multi-MessageBox may alleviate this problem somewhat
  • 28.