{"title":"How to work with a performance problem","url":"https://jonas-paprotka.de/docs/dev-itpro/performance/performance-work-perf-problem/","by":"JOP-AL","license":"Copyright (c) Microsoft Corporation. CC BY 4.0, https://creativecommons.org/licenses/by/4.0/; code samples MIT. From https://learn.microsoft.com/en-us/dynamics365/business-central/dev-itpro/performance/performance-work-perf-problem, MicrosoftDocs/dynamics365smb-devitpro-pb at 828b6ee (2026-11-19). Changed: includes filled in, links to this site, and for agents shortened without dropping a fact.","credit":"Microsoft Corporation, CC BY 4.0","origin":"https://learn.microsoft.com/en-us/dynamics365/business-central/dev-itpro/performance/performance-work-perf-problem","source":{"name":"Business Central developer and IT pro docs","repo":"https://github.com/MicrosoftDocs/dynamics365smb-devitpro-pb","commit":"828b6ee72fcd75755627cd6011f3d20899217ab2","date":"2026-11-19"},"checked":"2026-11-19","description":"Troubleshooting process that can help to guide you to find the root cause slow performance.","date":"2026-09-18","meta":{"topic":"how-to"},"outline":[{"level":2,"title":"A generic performance tuning process","slug":"a-generic-performance-tuning-process","at":172,"chars":1432},{"level":2,"title":"Performance analysis tools","slug":"performance-analysis-tools","at":1604,"chars":1825},{"level":2,"title":"Analyzing performance issues using the scheduled performance profiler","slug":"analyzing-performance-issues-using-the-scheduled-performance-profiler","at":3429,"chars":580},{"level":2,"title":"Analyzing performance issues using the in-client Performance Profiler","slug":"analyzing-performance-issues-using-the-in-client-performance-profiler","at":4009,"chars":1970},{"level":2,"title":"Analyzing performance issues using telemetry","slug":"analyzing-performance-issues-using-telemetry","at":5979,"chars":2198},{"level":2,"title":"Analyzing database performance issues using verbose telemetry","slug":"analyzing-database-performance-issues-using-verbose-telemetry","at":8177,"chars":780},{"level":2,"title":"Analyzing performance issues using database missing indexes","slug":"analyzing-performance-issues-using-database-missing-indexes","at":8957,"chars":606},{"level":2,"title":"Analyzing performance issues using database wait statistics","slug":"analyzing-performance-issues-using-database-wait-statistics","at":9563,"chars":487},{"level":2,"title":"Analyzing performance issues using the AL Profiler","slug":"analyzing-performance-issues-using-the-al-profiler","at":10050,"chars":1052},{"level":2,"title":"Example - How to deal with a performance problem in a report from a Marketplace extension","slug":"example---how-to-deal-with-a-performance-problem-in-a-report-from-a-marketplace-extension","at":11102,"chars":2058},{"level":2,"title":"Related information","slug":"related-information","at":13160,"chars":382}],"text":"What do you do if users complain that \"it's slow\"? In this section, we describe a troubleshooting process that can help to guide you to find the root cause of the problem.\n## A generic performance tuning process\nBefore you get started on solving a performance-tuning problem, it often helps to define and quantify \"slow\" and also negotiate acceptable values for execution time of the \"slow\" operations with users. Learning about the user's expectations is key when determining when the performance tuning effort is successful (or if the expectations are unrealistic).\nYou also need to measure how the system performs on the given operation before starting to change anything. This task is sometimes called \"establishing a baseline.\" To define baselines for performance, and to test whether new code or extensions introduce a performance regression, you can use the ../developer/devenv-performance-toolkit extension. The extension makes it easier to simulate and compare user experiences to your baseline. The following are examples of when the extension can help:\n When you want to ensure that new code doesn't introduce a regression.\n In a sandbox environment when, for example, the number of users running the same process increases significantly.\n When you want to roll out a new process, or install a new extension.\nTo solve a performance problem, a common pattern is to do iterations of the following tasks:\n1. Measure system performance and collect performance data\n2. Locate a bottleneck\n3. Eliminate the bottleneck\nContinue until the \"slow\" operations are comparable to the established baseline.\n## Performance analysis tools\nBusiness Central comes with tools that can be used to analyze a performance problem. In the following, you can read about the pros and cons of the different performance tools described below.\nPerformance tool|Properties\nScheduled performance profiler|Use the scheduled performance profiler to investigate on individual user interactions or system processes.<br> See ../administration/scheduled-performance-profiler-overview\nIn-client performance profiler|Good for troubleshooting a performance scenario in the web client. <br>No developer required to run the tool.<br>See In-client performance profiler overview<../administration/performance-profiler-overview>.\nTelemetry|Can be used if you want to investigate things after they happened. <br> Good for analyzing patterns across sessions. <br> Extensive resources available (Power BI report, Jupyter notebooks, sample KQL queries). <br> Little performance impact to have turned on always. <br> Telemetry must be enabled before the performance issue occurs. <br> Not every single AL call is logged to telemetry as this would slow down the Business Central server.\nVerbose telemetry|Gives you all SQL queries for the session where you repro the issue. <br> Slows down the system while running. <br> Can inject much data into Azure Application Insights. <br> Data collection must happen live.\nDatabase performance pages|The pages Database Missing Indexes and Database Wait Statistics show insights into database performance and how to fix it.\nAL profiler|Good to troubleshoot performance of a scenario. <br> Detailed information on where in the code the time is spent. <br> No need to enable this (always available). <br> Requires a developer to run the tool. <br> Data collection must happen live. <br>See ../developer/devenv-al-profiler-overview\n## Analyzing performance issues using the scheduled performance profiler\nThe scheduled performance profiler helps diagnose transient performance issues that occur when business processes interfere with each other, such as when scheduled jobs run simultaneously or during specific user workflows. Administrators can configure schedules to automatically capture snapshots of processes during defined time slots, producing individual profiles for retroactive investigation of what was running when performance degraded. See ../administration/scheduled-performance-profiler-overview.\n## Analyzing performance issues using the in-client Performance Profiler\nUse the in-client Performance Profiler page to record a slow scenario that can then be analyzed to see where time was spent. The tool is simple to use and can therefore be used by end-users, admins, and consultants to do performance investigations directly in the web client, to verify performance issues, understand which extensions are at play, and the likelihood of an extension being the cause of a performance degradation.\nTo profile a scenario, the overall steps are the following:\n1. Start the Performance Profiler\n2. Perform the (slow) scenario\n3. Stop the Performance Profiler\nFor more specific information on how to start and use the in-client Performance Profiler see In-client Performance Profiler overview<../administration/performance-profiler-overview>.\nWhen analyzing the result, you have three options:\n1. Look at Active Apps to see in which app time is spent. Did you recently install an app?\n2. Select an app to see how time is distributed over the apps and extensions that have code running in the app.\n3. Go to Time Spent by Application Object to see the distribution of time spent in the AL call tree. This option is for advanced users.\n4. Download the generated profile content and share it with a developer. You can view the profile file in Visual Studio Code by using the standard AL Profiler editor. From there, you can use existing options to access the AL code that was slow.\nThe in-client Performance Profiler is a lighter tool than the AL Profiler and, as it relies on sampling, it can perform in scenarios that would otherwise take longer time when using the AL Profiler with the instrumentation option. Learn more about how to use the in-client Performance Profiler to troubleshoot performance in In-client Performance Profiler overview<../administration/performance-profiler-overview>. Learn more about the AL Profiler in ../developer/devenv-al-profiler-overview.\n## Analyzing performance issues using telemetry\nTo monitor and analyze performance issues in the Business Central service, connect Azure Application Insights to the environments you want to get signals from. Learn more about enabling telemetry to Application Insights in Enable Sending Telemetry to Application Insights<../administration/telemetry-enable-application-insights>.\nIn the following, you can read about ways where telemetry can help troubleshoot performance issues.\nArea|Telemetry|Why\nSome page is slow (and it uses Page Background Tasks)|Authorization signal<../administration/telemetry-authorization-trace>|Each page background task opens a new session. Any expensive action in the OnCompanyOpen trigger slows down opening new sessions.\nSign-in|Authorization signal<../administration/telemetry-authorization-trace>|Any expensive action in the OnCompanyOpen trigger slows down opening new sessions.\nSomething was slow during this period of time|Company lifecycle signal<../administration/telemetry-company-lifecycle-trace>|Check whether a copy-company operation was running while the performance issue occurred.\nSomething was slow during this period of time|Database locks signal<../administration/telemetry-database-locks-trace>|Maybe the performance issue was because of locking in the database.\nSuddenly the XYZ page is slow|Extension lifecycle signal<../administration/telemetry-extension-lifecycle-trace>|Maybe an extension was installed that interferes with the page in question.\nSome pages or reports are slow to load|Long running SQL queries<../administration/telemetry-long-running-sql-query-trace>|Investigate whether the data operations on the page or report are taking a long time to complete.\nA report is slow|Report signal<../administration/telemetry-reports-trace>|Check whether the report is reading more data than you expected.\nSystem UI feels slow|Web service requests signal<../administration/telemetry-webservices-trace>|Calling your environment too aggressively with web service requests can affect performance of the system.\nThis page shows an overview of all currently available signals: Monitoring and Analyzing Telemetry<../administration/telemetry-overview>.\n## Analyzing database performance issues using verbose telemetry\nIf you want to capture all SQL queries for a short period of time for a given session, you can enable Additional logging from the Help & Support page. The logging lets you analyze queries that take a short time to run but happen frequently.\nRead more about extra logging in the /product-help-and-support#troubleshooting section of the Resources for Help and Support article in the business functionality docs.\nBy using Business Central on-premises, you can also change the default threshold that defines long running queries. Learn more about analyzing long-running operation (SQL query) telemetry in Analyzing Long Running Operation (SQL Query) Telemetry<../administration/telemetry-long-running-sql-query-trace>.\n## Analyzing performance issues using database missing indexes\nIf you notice that the information retrieval from your database is slow, you can index columns that are frequently used by the application. You can see the list of potential columns that can be indexed and other useful information about them on Database Missing Indexes. This information helps you to optimize the performance of your database and application.\nLearn more about missing indexes and how they help you achieve performance objectives in Missing Indexes in Dynamics 365 Business Central<../administration/database-missing-indexes>.\n## Analyzing performance issues using database wait statistics\nThe database performance can also be analyzed by checking the information at Database Wait Statistics. You can see the number of waits recorded for different wait categories, along with their wait times. The wait types give you an idea about the resources or operations that are responsible for the slow performance.\nSee Database Wait Statistics in Dynamics 365 Business Central<../administration/database-wait-statistics>.\n## Analyzing performance issues using the AL Profiler\nWith the AL Profiler for the AL Language extension, you can capture a performance profile of the code that was executed for a snapshot. Using the performance profiling editor view in Visual Studio Code, you can investigate the time spent on execution, using top-down and bottom-up call stack views.\nBefore capturing a snapshot with a performance profile, you can choose between using instrumentation or sampling for the profile. Instrumentation captures all method calls with precise timings, but has a higher performance load on the NST, which means that the snapshot will be larger and it can take longer to generate and extract the profile from the snapshot. Sampling captures method calls at predefined, repeated intervals. This has a smaller performance load on the NST, but calls shorter than the sampling interval might not be captured, and timings fall in sample buckets.\nRead more about how to use the AL profiler to troubleshoot performance here ../developer/devenv-al-profiler-overview.\n## Example - How to deal with a performance problem in a report from a Marketplace extension\nThis example illustrates how you can use the performance tuning process and telemetry to deal with a performance problem in a report from a Marketplace extension.\n Together with the tenant administrator/customer, you need to define \"slow\" and what the acceptable rendering time will be.\n Use telemetry to find data about time spent in the report. Long running SQL queries (event ID RT0005) and report rendering time (event ID RT0006) are the main data sources for this information. Telemetry for long running AL methods (event ID RT0018) might also be useful. Now you have baseline data.\n Also, use telemetry on report rendering time (eventId RT0006) to find out if the report is running with data access intent ReadOnly. If not, configure it to do so. Some reports write data, so this isn't always possible.\n Do you see long running SQL queries for the report in telemetry (eventId RT0005)? If so, you can add appropriate indexes using a table extension.\n After configuring, data access intent and maybe having added indexes, measure rendering time and compare with the baseline. Also check if the new rendering time is good enough with respect to the acceptable rendering time that you defined together with the tenant administrator/customer. If the performance is still not good enough, you probably need to involve the extension publisher.\n What is the SQL statement to SQL row ratio (get this using eventId RT0006)? Maybe the extension publisher can make the report more set-based when reading data. The telemetry samples repository at aka.ms/bctelemetrysamples<https://aka.ms/bctelemetrysamples> has KQL samples that can help with this analysis.\n If you have data to back it up, consider filing a performance support request to the extension publisher. They're probably interested in making their app better and faster. Provide info about indexes you added, the kusto queries you used and the results, and also if the report could run as ReadOnly by default.\n## Related information\nperformance-overview\nPerformance articles for developers<performance-developer>\nPerformance tips for business users<performance-users>\nHow application configurations affect performance<performance-application>\nperformance-online\nPerformance of on-premises installations<performance-onprem>\nMoving from OnCompanyOpen<../developer/devenv-oncompanyopencompleted>"}