You are on page 1of 22

Inside Dynamics AX 2012

Performance A1214
2
Disclaimer
2012 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other
product names are or may be registered trademarks and/or trademarks in the U.S. and/or other
countries. Other names and brands may be claimed as the property of others.

Microsoft Dynamics AX 2012 R2 is a pre-release product under development. The information herein is
for informational purposes only and represents the current view of Microsoft Corporation as of the date
of this presentation. Because Microsoft must respond to changing market conditions, it should not be
interpreted to be a commitment on the part of Microsoft. Microsoft cannot guarantee the accuracy of
any information provided after the date of this presentation. All product release dates and features
specified are preliminary based on current expectations, and are subject to change without notice.
Microsoft may make changes to specifications and product descriptions at any time, without notice.

Sample code included in this presentation is made available AS IS. THE ENTIRE RISK OF THE USE OR
THE RESULTS FROM THE USE OF THIS CODE REMAINS WITH THE USER.

MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN
THIS PRESENTATION. NO LICENSE, EXPRESS OR IMPLIED, BY ESTOPPEL OR OTHERWISE, TO ANY
INTELLECTUAL PROPERTY RIGHTS IS GRANTED BY THIS PRESENTATION. Microsoft products are not
intended for use in medical, life saving, or life sustaining applications.


Session Objectives
Tuning methodology
Tools
Whats new in Microsoft Dynamics AX
2012 R2 and its effect on Performance
X++ and SQL tuning tips and tricks
Benchmarks
Performance Story
New Performance features
Performance tuning
methodology
Usage profile
definition
Trace
collection
Trace
analysis and
findings
Remediation
Optional
Benchmark
execution
Tracing and Trace Parser
Tracing
Using standard Windows Crimson trace
Tracing Cockpit in Development Workspace
Perfmon data collector
xClassTrace to control tracing in X++ code
Max File Size for circular logging
Trace from multiple processes in one file
Trace Parser
Overview page with top X++ and SQL
Call tree view
Filter/Search X++ and SQL
Jump to call stack
New in CU4 and R2
Enabled Tracing of MSIL
Create sub trace(R2)
Advanced Trace comparison
Upcoming: Trace parser online version refresh
Visual Studio Profiling
Use before CU4 and R2
Used for tracing code running in MIL
Troubleshoot performance problems in
Batch jobs
Services
Code traversed to MIL via RunAs()
Industry standard for .Net tracing
Demo trace parser
Benchmarks
Day in the Life Benchmark
Hyper V
Enterprise Portal
High Volume inventory
Retail
Whats new in Microsoft
Dynamics AX 2012 R2
Partitioning
Separate model DB
Improvements in CU4 and Dynamics AX 2012 R2
Handling of big purchase orders
Faster Dimension Balance update
Inventory closing
Number Sequences(R2)
Tables per type (SCsc tables denormalized) (R2)
Customer Aging, Accrued purchase and Trial balance
reports
Global and private Address book
Extensible data security improvements

Top 10 tuning tips
Appropriate Caching for every table
If index is unique, mark it as unique
Enable Numbersequence caching wherever possible
Normalize BLOB usage
Use Display method caching where appropriate
Avoid code in update/insert/delete methods thereby disabling set
based processing
Is OCC enabled for your customizations
High performing list pages: Set fetch active only, Set firstfast, Reduce
order by
Ad hoc mode
In Select statement and query, specify field list
On modeled Query, turn Dynamic fields to No
On FormDataSource, turn OnlyFetchActive to Yes
Use static report design wherever applicable










Top 10 X++ Code tuning tips
Use set based operations
insert_recordset , update_recordset and delete_from
Aggregate instead of iterate
Dont loop for check if used
SQL TempDB (Microsoft Dynamics AX 2012)
Con2buf / buf2con (Microsoft Dynamics AX 2012)
Bundle calls from client to server
No join on in memory TempDB
Use Parallel processing wherever possible, Parallelism top picking
vs. bundling
Utilize SysGlobalCache and SysGlobalObjectCache (Microsoft
Dynamics AX 2012)
Avoid using PESSIMISTICLOCK in your code
Every call which does not need to be in a loop
should moved out











Top 10 SQL tuning tips
Ensure correct configuration (http://blogs.msdn.com/axperf)
Find and resolve Parameter sniffing
Have a clustered index on every table, overall ensure all your
queries are index supported
Dont create indexes directly on SQL
If index keys are a leading subset of another index, index can
probably be dropped
In Microsoft Dynamics AX 2012 use included columns to your
advantage
Evaluate compression to reduce IO footprint
Use Archiving (IDMF) to keep your data small
Resolve hidden scans
Support sortation with correct indexing


Microsoft Dynamics

AX
Performance/Scale Roadmap
Database scalability
scale up to
large hardware
Enable Microsoft
SQL Server 2005
performance
Scale out
architecture
for application
servers
Caching and
reliability changes
Optimistic
Concurrency
Control
Scale UP on the
application server
Focus on parallelism
and minimizing
batch window
Microsoft SQL
Server 2008
adoption
Extensive scale work
on integrations
Scale work on EP
Chattiness
reductions
Increase application
efficiency
Maximize usage of
Microsoft
SQL Server
2008/2008 R2 features
Core functions are
parallelism enabled
Run X++ in IL
Data caching
reengineered
Service enablement
of expensive ERP
processes
Improved Trace Parser
and tracing
experience
Microsoft Dynamics

AX 2012
Performance Features
Utilize SQL temp
tables
Included columns on
indexes
Full text index support
Computed column
support
Sync support for fill
factors, temp DB sort,
ONLINE, compression
Query timeout
setting
Async ledger updates
MRP scheduling
engine rewrite
Many batch jobs
parallelized - BOF
IL enablement for perf
critical components
Many core entities
(GAB, financial
dimensions) using
SysGlobalObjectCach
e
Number sequence
enhancements
Stored procedure for
budget check
Application
Microsoft Dynamics

AX 2012
Performance Features
Defer loading of
reference data
source
Declarative
Display Method
caching
Hide fact boxes/
preview panes
Limited paging
Async loading of
web parts
AppFabric(Velocit
y) as session state
store
Warm up page
Automatic Ad Hoc
mode for ListPage
Client side lookup
w/o postback
Hosted on AOS
Basic port
Light Weight
Session Pooling
Use SQL CDC for
change tracking
Business
Operation
Framework (BOF)
AIF/Services

Record Caching: Unique Index
Caching for Joins
Cache is enabled on both tables
Not Outer Join (excluding SC/sc) or Not Exists Join
Full Primary Key or Unique Index with AND on where predicate
Caching supports an SC/sc unique lookup caches the whole hierarchy
Supports joins of hierarchies by same rules
Supports non-SC/sc to SC/sc joins

Table A: Data
Record
Unique Index 1
Table B: Data
Record
Unique Index 2
Microsoft Dynamics

AX 2009
Client Client
Session cache Session cache
Microsoft Dynamics

AX 2012
Client Client
Session cache Session cache
Real global cache on Server

Class
SysGlobal
Cache


Class
SysGlobal
ObjectCach
e


Class
SysGlobal
Cache


TempDB Temp Table
TempDB temp table is created on SQL Servers TempDB
TempDB temp table can join with permanent tables efficiently
Insert into TempDB temp table cause a AOS-SQL roundtrip
Make sure to use insert_recordset to populate
Samples:
SubledgerJournalizer::loadSubledgerJournalTmpDetail


Intermediate Language
DB
AOS
RPC

Services

X++
Pcode
Interpreter
X++
IL Code(DLL)
.Net Runtime
SNAC

RunAs()
Batch Jobs
Services
2011 Microsoft Corporation. All rights
reserved

SysOperation Framework
Use AOS Services to run business logic
Services run in IL
No way to call back to client, so no chattiness
Automatically dialog generation based on data
contract
Choose execution mode no need to change
code!
Synchronous
Asynchronous
Reliable async
Batch

New performance
configurations
SQL Admin Form
Included columns for index
Client Performance Options
Server Configuration
Declarative display method caching
Session Eval SESSION CODE:
A1214
Text SESSIONID
CODE [space]
ANSWER to 22333
or
http://PollEv.com
1. Overall satisfaction
ANSWER
Excellent 1
Very Good 2
Good 3
Fair 4
Poor 5
2. Quality of speakers
ANSWER
Excellent A
Very Good 9
Good 8
Fair 7
Poor 6
3. Session provided info I can apply
ANSWER
Strongly Agree B
Somewhat Agree C
Neither Agree or Disagree D
Somewhat Disagree E
Strongly Disagree F
4. Comments about this session
ANSWER G [space] <Your Comments>

You might also like