Professional Documents
Culture Documents
Martin Zhen
Principle technical consultant @ OutsourceAX Development Martin.zhen@outsourceax.com
Agenda
Performance Tuning
System monitoring/tooling for SQL Problem solving strategy Dynamics AX Trace Parser Tool Performance Analyzer for Microsoft Dynamics Tuning Strategy Solid State Drives
-- Unidentified issue
o No idea when it happens and/or what functional process(es) is/are slow
Identified issue
Reproducible only in customer's environment
Check hardware Check software, settings and setup Analyze the process (Trace Parser, Profiler)
Unidentified issue
Check hardware Check software, settings and setup Long term data collection (AXPERF, IDM)
Minimum server-server network bandwidth is 1 gbps Netmon v3.2 for Windows Server 2003 and 2008 download
http://www.microsoft.com/downloads/details.aspx?familyid=f4db40af-1e08-4a21a26b-ec2f4dc4190d&displaylang=en
Verify that compatibility level of AX database is to 90 (SQL 2005) or 100 (SQL 2008). Auto Create Statistics and Auto Update Statistics set to True. If Autogrowth is configured, use MB (usually 100-500) rather than percent for both data and log files. Auto Shrink always set to False.
SQL administration
Check if index defragmentation (rebuild) is done on a regular base. There should be a maintenance job for this task and current state of index fragmentation can for example be verified with DMV sys.dm_db_index_physical_stats. Check if update statistics is done
Other tools:
SQL Server Profiler
AX Code Profiler (AX client, Tools\Development tools\Code profiler) AX SQL Statement log (AX client, Tools\Options and then SQL tab page) SQL Server DMVs, Standard reports (from SQL Server Management Studio) SQL Server Performance Dashboard reports
http://www.microsoft.com/downloads/details.aspx?FamilyId=1 d3a4a0d-7e0c-4730-8204e419218c1efc&displaylang=en
AX Trace Parser
The Microsoft Dynamics AX Trace Parser is a user interface and data analyzer added to Microsoft Dynamics AX 2009 and built on top of Microsoft SQL Server 2005 and the Event Tracing for Windows (ETW) framework. The ETW framework allows an administrator to conduct tracing with system overhead of approximately 4%.
AX Trace Parser
The Trace Parser enables:
Rapid analysis of traces to find the longest running code Longest running SQL query Highest call count, and other metrics useful in debugging a performance problem. A call tree of the code that was executed, allowing the developer to gain insight quickly into unfamiliar code. Jumping from the search feature to the call tree, so that the person analyzing the trace can determine how the problematic code was called.
AX Trace Parser
AX Trace Parser
Mandatory settings:
Allow client tracing on Application Object Server instance .Net Framework 3.5 SP1 Free disk space
AOS trace files AOS computer Log\<servername>_<timestamp>.trc Client computer log\<Username>_<ClientIP>_<sessionID>_<client>.trc
AX Trace Parser
Tracing option
RPC round trips to server
Description
Trace all remote procedure call (RPC) round trips from any client to the server. X++ methods that are invoked on the server. Limit tracing to the specified number of nested method calls. Trace all function calls that are invoked on the server. Trace all SQL Server statements that are invoked on the server. Trace all columns that are used as input bind variables. Trace all rows that are fetched using SQL Server. Count all rows that are fetched, and record the time spent fetching.
Location
Client, Server
X++ method calls Trace all Number of nested calls: Function calls SQL statements Bind variables Row fetch Row fetch summary (count and time)
Client, Server Client, Server Client, Server Client, Server Client, Server Client, Server Client, Server
Trace each time the AOS connects and disconnects from the
Client, Server
AX Trace Parser
Please make sure
AOS service account needs admin rights Be sure .net Framework 3.5 SP1 is installed.
Error: System.MissingMethodException on the callstack WaitHandle.WaitOne()
Installing AX integration will integrate with all AOSs on your server (no axc file stuff) tracemaxfilesize should be set to a value less than available disk space. By default it is 10000 for 10GB. AX client should be started under UAC Administrator when on Vista or higher
AX Trace Parser
DEMO: AX Trace Parser
Tuning Strategy
Dont lose time measuring the consequences, get straight down to business with the queries (the source). First, identify inefficient queries
- Use Performance Analyzer to monitor queries:
For example, find out the top ten most expensive SQL statements
Tuning Strategy
Dynamics AX kernel generated the SQL statement Tweak the X++ SQL Statement and AOT Queries Use SQL Server Profiler to monitor the generated SQL statement
SSDs are ideal for tempdb, given tembdbs disk oriented workload SSDs have lower mean time between failures than HDDs no moving parts to wear down HDDs involve physically moving metal at high speed
Contact OutsourceAX Development support for more information about the performance service. support@outsourceax.com
Thanks you! Questions? If you have follow up questions, please feel free to send me an email. Martin.zhen@outsourceax.com