Microsoft Dynamics AX Support

This blog contains posts by the Microsoft Dynamics AX Support Teams Worldwide

AX Performance Troubleshooting Checklist Part 1B [Application and AOS Configuration]

Updated on 09/09/16 for DynamicsPerf v2.0.

This is the second page of Part 1, in a two part troubleshooting check list for general performance on Microsoft Dynamics AX. This page (Part 1B) covers  AX application and AOS configuration settings.

Please see the previous page for the introduction and Part 1A of the check list, which covers SQL Server and Storage Settings. Part 2 (following on later) will cover hardware, indexing, queries,  blocking and code (at a high level).

Below there is also a link to a script you can use to gather some of the required information from your system. It requires the Performance Analyser 2.0 to be installed first.

Part 1B: AX application and AOS configuration settings

Analysis script:

Some settings can be checked manually in the application (steps given in the links below) or AX Server Configuration Utility (Start > Administrative Tools > Microsoft Dynamics AX Server Configuration).

Application settings
Kernel & Application Builds

-Generally we recommend a recent kernel build and the highest possible application build, in order to get the benefit of the latest hot fixes. For example, on support we have seen a number of AX 2012 (RTM and R2) customers with performance issues benefiting from installing CU7 (kernel and application).
-Have a regular patching strategy in place.
How to…
Overview of Microsoft Dynamics AX build numbers:
Patching Strategy for Dynamics AX:
Number sequences:

-For each number sequence, unless there is a regulatory requirement that you use continuous, we recommend that you use non-continuous for better performance*
-Where number sequences absolutely must be continuous, carefully consider server usage when you plan the cleanup process. We recommend that you perform the cleanup as a batch job during non-peak hours.*
-Use pre-allocation for non continuous number sequences**

*Further details: Number sequence overview [AX 2012]

How to…
Number sequences (form) [AX 2012]:

AX 2009: “Introduction to AX 2009” training materials on Partnersource or Customersource, e.g. 5)

Determining what pre-allocation to set: use the script provided in Performance Analyser 1.20, in the folder: Analyze AX Configuration, “Analyze AX Configuration”, section “NUMBER_SEQUENCE_USAGE”

Database logging and alerts:

-Only use these when absolutely necessary. Certainly don’t enable it on transactional tables. See:
(similar principle applies to alerts)
How to…
Configure and manage database logging [AX 2012]:

AX 2009: “Administration in Microsoft Dynamics AX 2009” training materials on Partnersource or Customersource, e.g. (Chapter 6 – alerts)

Extensible Data Security (XDS) / Record Level Security (RLS):
[RLS will be removed in a future version]

-Exercise caution with the queries used, for example: validate that ranges are not using wildcards at the start of the criteria (*xxxx), as this can result in index scans in SQL; keep the queries as simple as possible. Also be aware record level security can affect set based operations:
How to…
Developing Extensible Data Security Policies (White paper) [AX 2012]

Manage record level security [AX 2012]

Manage record-level security [AX 4.0 & 2009]:

Configuration Keys:

-Turn off ‘keep update objects’ configuration key for new installations.

-Turn off any other configuration keys which are not required (for similar reasons to those above and it is also potentially skipping additional logic in the code which is not required).

How to…
Configure application functionality [AX 2012]:

AX 2009: “Administration in Microsoft Dynamics AX 2009” training materials on Partnersource or Customersource, e.g. 1)

Memo fields

-Review the use of memo and container fields in application tables.
Best Practices: Table Fields [AX 2012]
How to…
Performance – memo/ntext fields:
Entire table caching:

-Avoid using EntireTable caches for large tables (in AX 2009 over 128 KB or 16 pages, in AX 2012 over ‘entire table cache size’ application setting [default: 32KB, or 4 pages]) – move to record caching instead.
-Avoid using EntireTable caches for highly updated tables – move to record caching instead.
-Candidates for EntireTable cache – static tables (e.g. parameter tables) that have no cache enabled and are smaller than 128K (16 pages) [AX 2009] or smaller than the entire table cache size application setting (default=32KB or 4 pages) [AX 2012].
Set-based Caching [AX 2012]
How to…
Table properties:

Best practices for table properties:

AX 2012 entire table cache size setting:
(section: ‘configuring the cache sizes’)

Record caching

-Ensure there is an appropriate unique index (AX 2012) or primary key (AX 2009) to support record caching for frequently executed queries on each table.
-Check for custom tables where the ‘table group’ property is ‘none’ and the cache lookup property is ‘miscellaneous’. This can often indicate that caching hasn’t been considered, because these are default values.
Single-record Caching [AX 2012]
How to…
As a rough guide (at your own risk, bearing in mind there can be exceptions including the above EntireTable best practices), you can use the following approach:

  1. Set TableGroup property according to how it is used (following advice in the references below).
  2. Set the CacheLookup property based on TableGroup (some table groups only applicable to AX 2012; see above links): Parameter = EntireTable, Group / Reference / Main = Found, Transaction/Transaction header/Transaction line/Worksheet/Worksheet header/Worksheet line = NotInTTS
[AX 2012 only]
Client performance options:

-Part 1 – Review set up as per the blog (see right).
-Bear in mind development guidance in the blog for code review (check list part 2).
How to…
Microsoft Dynamics AX 2012: Client Performance Options:
[AX 2012 only]
Server Configuration – Performance Optimization:

-Generally we recommend to keep the defaults – establish the reasons behind any changes from the defaults.
How to…
Server configuration (form) [AX 2012]:
Server Configuration – Batch server schedule:

-Max threads can vary widely depending on the workload.
-Schedule can be used to define a window when batch processing occurs, to avoid / reduce impact on other processes.
How to…
Server configuration (form) [AX 2012]: 2009:Administration > Setup > System > Server configuration
OCC Enabled

-Default (recommended)=’Yes’. Specifies whether the optimistic concurrency mode is enabled for a table. When this mode is enabled, data is not locked from future modification when it is fetched from the database. Data is locked only when the actual update is performed.
How to…
Server configuration (form) [AX 2012]:
AOS Configuration settings

-Generally we recommend to keep the defaults in your production environment; establish the reasons behind any changes from the defaults.
How to…
Manage an AOS configuration:

Application Object Server options:

Index Hints:
-Default (best practice) = disabled. See also: Application Object Server (AOS) configuration commands [AX 2012]
-Default = enabled. Best practice = disabled. See also: Application Object Server (AOS) configuration commands [AX 2012]
Maximum buffer size:
-Defaults (best practice): 24kb (AX 2012 R2 & R3=48kb). See also: Tune data access settings [AX 2012]. Not to be confused with MaxBufferSize registry key below.
Statement cache:
-Defaults (best practice): AX 2012 RTM = 256, AX 2012 R2 & R3 = 450
Debug settings:
-Enable breakpoints to debug X++ code running on this server & Enable global breakpoints. Default (best practice): disabled (in production).
-Use literals in complex joins from X++; Use literals in join queries from forms and reports. Defaults (best practice): disabled.
Minimum packet size to compress (in KB):
-Default (best practice) = 1kb.
Enable the hot-swapping of assemblies for each development session:
-Default (best practice) = disabled.
Generate ORDER BY clauses from WHERE clauses :
-Default (best practice) = disabled.
Maximum open cursors:
-Default (best practice)=90.See also:
Additional AOS commands:
-Default (best practice) = none.
Processor affinity

-Default (best practice) = disabled. However if you must have more than one AOS instance per server, enable it to reduce context switching.
How to…
Divide the number of AOS processors equally among the instances, e.g. with 4 processors and 2 AOS services on one machine: processors 1 & 2 = AOS instance 1, processors 3 & 4 = AOS instance 2.

Set processor affinity [AX 2012]:

Context_Info (AX 2012 only) [registry setting]:
-Default = disabled. Small performance overhead but recommended for troubleshooting.
MaxBufferSize [registry setting]:
Defaults: AX 2009 =  10MB, AX 2012 = 50MB.
How to…
Note: Although the blog covers AX 4.0 and AX 2009, a similar principle applies to AX 2012 as well. Just change the registry key names in the blog from 4.0 or 5.0, to 6.0. e.g.: Client key would be [HKEY_CURRENT_USER\Software\Microsoft\Dynamics\6.0\Configuration\(configuration name)]