How to check AX 2012 performance issue


Hi Technical,

Today, in this post we will share how you can check AX performance issues. There are a bunch of methods you need to follow to check performance of AX, we have shared in a way like most critical to lowest critical so that you can get what you are finding for at the earliest...

Please follow the steps...

Method 1: 

At very first, we will check if there is any blocking in the query which is effecting AX performance.

a) If you are a DB administrator, run below Query on DB.

SET NOCOUNT ON
GO
SELECT SPID, BLOCKED, REPLACE (REPLACE (T.TEXT, CHAR(10), ' '), CHAR (13), ' ' ) AS BATCH
INTO #T
FROM sys.sysprocesses R CROSS APPLY sys.dm_exec_sql_text(R.SQL_HANDLE) T
GO
WITH BLOCKERS (SPID, BLOCKED, LEVEL, BATCH)
AS
(
SELECT SPID,
BLOCKED,
CAST (REPLICATE ('0', 4-LEN (CAST (SPID AS VARCHAR))) + CAST (SPID AS VARCHAR) AS VARCHAR (1000)) AS LEVEL,
BATCH FROM #T R
WHERE (BLOCKED = 0 OR BLOCKED = SPID)
AND EXISTS (SELECT * FROM #T R2 WHERE R2.BLOCKED = R.SPID AND R2.BLOCKED <> R2.SPID)
UNION ALL
SELECT R.SPID,
R.BLOCKED,
CAST (BLOCKERS.LEVEL + RIGHT (CAST ((1000 + R.SPID) AS VARCHAR (100)), 4) AS VARCHAR (1000)) AS LEVEL,
R.BATCH FROM #T AS R
INNER JOIN BLOCKERS ON R.BLOCKED = BLOCKERS.SPID WHERE R.BLOCKED > 0 AND R.BLOCKED <> R.SPID
)
SELECT N'    ' + REPLICATE (N'|         ', LEN (LEVEL)/4 - 1) +
CASE WHEN (LEN(LEVEL)/4 - 1) = 0
THEN 'HEAD -  '
ELSE '|------  ' END
+ CAST (SPID AS NVARCHAR (10)) + N' ' + BATCH AS BLOCKING_TREE
FROM BLOCKERS ORDER BY LEVEL ASC
GO
DROP TABLE #T
GO

b) Run query sp_who2 <SPID from blocking query>
c) Run DBCC inputbuffer(<SPID>)  Make a note of command and server where it is running
d) If SPID is in suspended or Sleeping state > Kill it (query is: Kill <SPID>)

Method 2: 

You might have application server and terminal server installed for your AX. Login to each one by one and open task manager, check CPU and memory utilization.

Note: CPU and memory utilization should be normal, if it's high check, is there any process running on server which is consuming more memory and high CPU utilization? If any process is there try to wait for sometime while the process ends.



Method 3: 

If you have multiple instance of application server, please follow the steps...

1. Check all application instance servers that AX services are in running status.


Note: If any instance service is not running, try to start it.

2. Check for load balancing, go to System administration/Area page/Users/Online users, please see the below image for your reference...


Note: If the number of clients are high then ask users to leave the session if they are not using the system for sometime.

We think these above methods will help you to rectify the performance issue. Please share your valuable ideas through comments so that we together can help others for better learning.

Author:
Chirag Gupta
Microsoft Dynamics 365 AX Technical Consultant at IBM Bangalore

Date:
12-Sep-2019

Happy Learning !!

Comments

Popular posts from this blog

[Solved] : Error: String or binary data would be truncated. Cannot execute a data definition language command on Vendor (VendLedgerReconciliationTmp)

AX 2012 - Command prompt compilation / AxBuild.exe for Parallel Compile on AOS of X++ to P-code / Parallel Compilation

AX 2012 - How to send SSRS report in email as an attachment using X++

AX 2012 - How to stop AOS when services got stuck at stopping status

AX 2012 - How to make a form field mandatory

Error: There was no endpoint listening at net.tcp://your_server_name:8201/Dynamics AX/Services…

Fetch vendor address using X++ in AX 2012

AX 2012 - How to print current date and time on SSRS Report

[Solved] : AX 2012 - No connection could be made because the target machine actively refused it 192.168.10.249:8201

[Error] - Error in unit of amount in currency KES. Must be rounded to 0.01 | The unit of 37.563.5343100000000000 KES being posted to account 32710001-- is outside the current penny rounding threshold | Posting has been canceled