To Discover the Cause of Performance Degradation
Suppose that after publishing a customization project, you notice that the MYOB Acumatica performance on a customized form is being degraded. To check whether the content of the customization project is the cause of the performance degradation and to find the code fragment that is affecting system performance, you can use the Request Profiler.
To Check Whether a Customization Project Affects System Performance
To check whether a customization project is degrading the MYOB Acumatica performance, perform the following actions:
- Test the performance with the customization project unpublished as follows:
- Unpublish the customization project that you suspect is degrading performance, as described in Unpublishing Customization Projects.
- In the browser, open the form that you suspect has experienced performance issues since the customization project was published.
- Click Start Logging in the Profiler dialog box, which opens. The Request Profiler starts logging URL requests, SQL queries, exceptions, and warnings and errors. on the form title bar, and click
- On the form, sequentially perform each action that has been customized on the form.
- Click Stop and Export in the Profiler dialog box. The Request Profiler returns to the default monitoring and exports a ZIP archive with the log files that contain information in JSON format about the performed URL requests, SQL requests, and stack trace. on the form title bar, and click
- Test the performance with the customization project published as follows:
- Publish the customization project, as described in To Publish a Single Project.
- Open the Request Profiler (SM205070) form, and on the form toolbar, click Clear Log to clear the table.
- In the browser, open the form that you used for the performance test.
- Click Start Logging in the Profiler dialog box, which opens. on the form title bar, and click
- On the form, sequentially perform each action that has been customized on the form.
- Click Stop and Export in the Profiler dialog box. on the form title bar, and click
- Open the files with the logs to compare the duration values for the same actions.
The customization of the business logic for a form can degrade the system performance; however, the duration of an action should not increase by more than 10 percent. If the duration of an action on the customized form is more than 10 percent longer than the duration of the same action before customization, we strongly recommend that the customization code be reworked. To do this, follow the instructions described in To Find the Code Fragment That Is Affecting System Performance.
- On the form toolbar of the Request Profiler form, click Clear Log to delete the logged data from the database.
To Find the Code Fragment That Is Affecting System Performance
If you have confirmed that the system performance is being degraded on a customized form, you can use the Request Profiler to discover the code fragment that is causing the performance degradation. To do this, perform the following actions:
- Reproduce the performance degradation with the logging turned on as follows:
- In the browser, open the customized form that you have confirmed as experiencing performance degradation.
- Click Start Logging in the Profiler dialog box, which opens. The Request Profiler starts logging URL requests, SQL queries, exceptions, and warnings and errors. on the form title bar, and click
- On the form, sequentially perform the actions that you identified as executing too slowly.
- Click Stop and Export in the Profiler dialog box. The Request Profiler returns to the default monitoring and exports a ZIP archive with the log files that contain information in JSON format about the performed URL requests, SQL requests, and stack trace. on the form title bar, and click
- Investigate the logs as follows:
- On the form toolbar of the Request Profiler (SM205070) form, click Refresh Results to refresh the log table.
- On the Requests tab, rearrange the log records in descending
order to find the URL requests with the highest values in each of the following
columns:
- Server Time, ms
- SQL Time, ms
- Server CPU, ms
- SQL Count
- Click a record that has an unusually large value in any column listed in the previous instruction (or in multiple columns), and then click View SQL on the table toolbar to open the View SQL dialog box.
- In the dialog box, use the standard table navigation buttons to explore the list of SQL requests, which are initially ordered by the Start Time column.
- If needed, in the table, rearrange records based on the value in the SQL Time, ms column in descending order to find the SQL requests with the longest duration.
- To view the SQL statement and the stack trace for the SQL request, click the request in the table and then click Switch Between Grid and Form () on the table toolbar.
- In the stack trace, find the method that is causing the performance degradation.
- Analyze and correct the customization code as follows:
- Launch Microsoft Visual Studio.
- In Visual Studio, open the file with the method; the file is currently saved in the App_RuntimeCode website folder.
- Analyze the method body to find the code snippet that is causing the issue.
- On the form toolbar, click Clear Log to delete the SQL request data from the database.