Dynamics AX 2012 health check and performance optimization

Most slow AX 2012 systems are slow for a short list of reasons: SQL Server settings left at defaults, missing or bloated indexes, oversized log and history tables, batch jobs fighting users on the same AOS, and X++ code that loops row by row. A health check measures which of these apply to you and fixes them in order of impact, which matters more now that AX 2012 R3 is past the end of Microsoft's extended support.

When this makes sense

  • Month-end inventory close, MRP or invoice posting runs far longer than it used to
  • Users report forms freezing at certain times of day, usually when batch jobs run
  • Your AX database has grown large and nobody has run cleanup jobs in years
  • You plan to keep AX 2012 running for several more years before moving to Dynamics 365 and need it stable
  • You moved AX to new hardware or a newer SQL Server version and performance got worse

What the engagement covers

SQL Server configuration

Check MAXDOP, cost threshold for parallelism, the 'optimize for ad hoc workloads' setting, memory limits, tempdb file layout, READ_COMMITTED_SNAPSHOT and statistics update jobs against Microsoft's guidance for AX workloads.

Index and query analysis

Find the most expensive queries with DMVs, Query Store on SQL Server 2016 or later, or the Performance Analyzer for Microsoft Dynamics (DynamicsPerf), then add, adjust or remove indexes through the AOT so they survive synchronisation.

AOS and batch topology

Review AOS instance count, load balancing, batch server groups and thread counts so heavy batch work runs on dedicated AOS instances away from interactive users.

Data cleanup

Size and clean SysDatabaseLog, batch job history, AIF message logs, InventSumLogTTS and old sales update history tables using standard cleanup jobs, after agreeing retention with finance and audit.

X++ code review

Use Trace Parser to find row-by-row loops, display methods in grids, and missing caching, and rewrite hot paths with set-based operations such as insert_recordset and update_recordset where safe.

Inventory and MRP settings

Review inventory close frequency, dimension groups, master planning helper threads and coverage settings that drive the longest batch runtimes.

How it runs

  1. 1

    Baseline (1 week)

    • Capture runtimes for key batch jobs and slow forms
    • Collect SQL wait statistics and top queries
    • Record database size by table
  2. 2

    Diagnose (1-2 weeks)

    • Run Trace Parser sessions on the slowest processes
    • Review SQL, AOS and batch configuration
    • Rank findings by expected impact and risk
  3. 3

    Fix and verify (2-6 weeks)

    • Apply configuration and index changes in test, then production
    • Run approved cleanup jobs in controlled windows
    • Re-measure against the baseline

What you get

  • Baseline performance report with runtimes and wait statistics
  • Ranked findings list with effort and risk for each
  • SQL Server and AOS configuration change log
  • Index changes implemented in the AOT model
  • Data retention and cleanup schedule
  • Before and after comparison report

What drives cost and effort

Database sizeLarger databases take longer to analyse, back up and clean, and need longer maintenance windows.
Customisation volumeHeavy custom X++ in posting and planning means more code review time.
Access to production metricsWithout Query Store or DynamicsPerf history, more time is spent capturing data before diagnosing.
Change windowsStrict change control and short windows stretch the fix phase over more weeks.
Infrastructure ownershipIf SQL Server is managed by a hosting provider, coordination adds time.

Fixed-scope health check

Getting a ranked list of problems and quick wins in a few weeks.

Health check plus remediation

Teams without AX developers who need the fixes implemented and measured.

AX run-out support retainer

Companies keeping AX 2012 for several years who want ongoing monitoring until migration.

Questions to ask any Microsoft Dynamics AX consultant

What will you measure before changing anything?

Without a baseline you cannot prove a change helped or catch one that hurt.

How do you add indexes so they survive a database synchronisation?

Indexes created directly in SQL Server get dropped or conflict when AX synchronises the data dictionary.

Which cleanup jobs will you run, and what data is lost?

Some history supports audit and costing; retention must be agreed with finance first.

Have you tuned AX on our SQL Server version?

Cardinality estimator changes between SQL versions affect AX queries in specific ways.

How does this work feed a future D365 migration?

Cleanup and customisation analysis done now reduces migration scope later.

Score candidate partners side by side with the free Implementation Partner Scorecard

Where these projects go wrong

Changing many settings at once

Change in small batches and re-measure so you know which change caused which effect.

Deleting history that audit needs

Agree retention in writing and archive to a read-only database before deletion.

Index bloat from over-tuning

Review write-heavy tables before adding indexes and remove unused ones found in DMV usage statistics.

Unsupported platform exposure

Document the remaining run-out period and pair tuning with a migration plan.

If AX will be retired within a year, limit work to the few configuration fixes and cleanup jobs with the biggest payoff, and put the rest of the budget into the migration. Deep X++ refactoring rarely pays back on a system that is about to be switched off.

Frequently asked questions

Should 'optimize for ad hoc workloads' be on for AX?

It is commonly enabled on AX SQL Servers because AX generates many single-use query plans that bloat the plan cache. Test it on your workload and watch plan cache memory before and after.

What MAXDOP should AX 2012 use?

Microsoft guidance for AX has commonly recommended MAXDOP 1 for OLTP-heavy AX databases, with exceptions for reporting servers. Measure on your system, because heavy batch and reporting workloads can behave differently.

Is AX 2012 still supported?

AX 2012 R3 has passed the end of Microsoft extended support, so there are no new security fixes from Microsoft. Many companies still run it, which makes stability, security hardening and a migration plan more important.

Will more hardware fix AX performance?

Sometimes, if you are memory or storage bound, but most AX slowness comes from queries, indexes, data volume and batch contention. Measure waits first so you buy hardware only for a proven bottleneck.

Can AI help with AX 2012?

Yes, a read-only AI layer can answer questions over AX data without touching the AOS, which is useful during a long run-out. Netray builds these on private infrastructure, and our agents also speed up analysis of trace and query data during a health check.

Talk to a Microsoft Dynamics AX consultant

Tell us where you are and what you need. You get a straight answer on scope, approach and whether you need outside help at all.

Get Microsoft Dynamics AX 2012 alerts

Support and maintenance deadlines, release changes that affect Microsoft Dynamics AX 2012 sites, and new free Microsoft Dynamics AX 2012 tools. A couple of emails a month at most.

Free. Unsubscribe with one click from any email.