Skip to content

Commit 01c171e

Browse files
authored
Merge pull request #2717 from laujan/368093-latency-best-practice
latency best practices
2 parents 64c497a + 360cbd0 commit 01c171e

File tree

7 files changed

+128
-2
lines changed

7 files changed

+128
-2
lines changed
Lines changed: 123 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,123 @@
1+
---
2+
title: Troubleshoot latency issues with Document Intelligence API
3+
titleSuffix: Azure AI services
4+
description: Learn troubleshooting tips, remedial solutions, and best practices for addressing Document Intelligence latency issues.
5+
author: laujan
6+
manager: nitinme
7+
ms.service: azure-ai-document-intelligence
8+
ms.topic: troubleshooting
9+
ms.date: 02/05/2025
10+
ms.author: lajanuar
11+
---
12+
13+
# Troubleshooting latency issues in Azure AI Document Intelligence
14+
15+
This article presents troubleshooting tips, remedial solutions, and best practices to address Document Intelligence latency issues. Latency refers to the duration an API server takes to handle and process an incoming request before delivering the response to the client. The time required to analyze a document varies based on its size (such as the number of pages) and the content on each page.
16+
17+
Document Intelligence operates as a multitenant service, ensuring that latency for similar documents is comparable, though not always identical. Variability in latency and performance is an inherent characteristic of any microservice-based, stateless, asynchronous service, especially when processing images and large documents on a large scale. Despite continuous efforts to increase hardware capacity and enhance scalability, some latency issues can still arise during runtime.
18+
19+
> [!NOTE]
20+
>
21+
> * Azure AI services don't provide a Service Level Agreement (SLA) for latency.
22+
> * The Document Intelligence API offers asynchronous functionality, allowing you to access results up to 24 hours after sending your request to our backend.
23+
> * Use the request ID provided by the POST operation to retrieve these results. If you encounter issues during your standard polling sequence, save the request ID and try again later before considering a retry. For further assistance, refer to our [service page](../service-limits.md#detailed-description-quota-adjustment-and-best-practices).
24+
25+
## Set your latency baseline
26+
27+
To evaluate latency, you should first establish baseline metrics for your specific scenario. These metrics give you the expected end-to-end and server latency within the context of your application environment. Once you have these baseline metrics, it becomes easier to distinguish between expected and unexpected conditions.
28+
29+
## Check Azure region status
30+
31+
When you're experiencing latency issues, the first step is to check [Azure status](https://azure.status.microsoft/status) for any current outages or issues that might impact your services.
32+
33+
* All active events are listed under the `Current Impact` tab.
34+
35+
* You can also check your resource in the host region. Go to Geography → Products And Services → AI + Machine Learning → Azure AI Document Intelligence and check the status for your region:
36+
37+
:::image type="content" source="../media/latency/azure-status.png" alt-text="Screenshot of the Microsoft Azure status page." lightbox="../media/latency/azure-status.png":::
38+
39+
## Check file size
40+
41+
Monitor the size of files you send via the request API. Processing larger files in parallel can result in increased processing times. Normalize your metric by measuring latency per page. If you observe sustained periods (exceeding one hour) where latency per page consistently surpasses 15 seconds, consider addressing the issue.
42+
43+
## Check Azure Blob storage latency
44+
45+
The size of a request affects latency in Azure Storage operations. Larger operations take more time to complete due to the increased volume of data transferred over the network and processed by Azure Storage.
46+
47+
Azure Storage provides two latency metrics for block blobs in the Azure portal:
48+
49+
* End-to-end (E2E) latency measures the interval from when Azure Storage receives the first packet of the request until Azure Storage receives a client acknowledgment on the last packet of the response.
50+
51+
* Server latency measures the interval from when Azure Storage receives the last packet of the request until the first packet of the response is returned from Azure Storage.
52+
53+
To view latency metrics, navigate to your storage resource in the Azure portal:
54+
55+
* On the left navigation window, select **Insights** from the **Monitoring** drop-down menu.
56+
57+
* The insights tab opens a window that includes a chart showing both `E2E` and `Server` latency metrics:
58+
59+
:::image type="content" source="../media/latency/azure-storage.png" alt-text="Screenshot of Azure Storage latency metrics in the Azure portal.":::
60+
61+
62+
For more information, *see* [Latency in Blob storage](/azure/storage/blobs/storage-blobs-latency).
63+
64+
65+
## Check monitoring metrics for your resource
66+
67+
Azure portal monitors offer insights into your applications to enhance their performance and availability. There are several tools that you can use to monitor your app's performance in the Azure portal:
68+
69+
1. On the **Overview** page, select **Monitoring**, select the time period, and review the **Request latency** metrics on page.
70+
71+
:::image type="content" source="../media/latency/azure-portal-monitoring.png" alt-text="Screenshot of Azure usage monitoring metrics in the Azure portal.":::
72+
73+
1. On the left navigation window, select **Metrics** from the **Monitoring** drop-down menu.
74+
75+
* In the main window, select ➕**Add metric**.
76+
77+
* Keep the **Scope** and **Metric Namespace** fields unchanged. Add the **Latency** parameter to the **Metric** field and adjust the **Aggregation** field as needed.
78+
79+
:::image type="content" source="../media/latency/azure-portal-monitoring-metrics.png" alt-text="Screenshot of add your own metrics setting in the Azure portal.":::
80+
81+
## Set a latency alert in the Azure portal
82+
83+
Alerts assist you in identifying and resolving issues by providing proactive notifications when Azure Monitor data suggests a potential issue. An alert rule keeps an eye on your data and notifies you when set criteria are met on your specified resource. You can set up an alert in the Azure portal as follows:
84+
85+
1. On the left navigation window, select **Alerts** from the **Monitoring** drop-down menu.
86+
87+
1. Select the **Create alert rule** button.
88+
89+
1. In the new window that opens, select **Latency** from the **Select a signal** drop-down menu.
90+
91+
:::image type="content" source="../media/latency/azure-portal-create-alert.png" alt-text="Screenshot of the create an alert rule page in the Azure portal.":::
92+
93+
1. Configure the alert by completing the fields on the page.
94+
95+
1. After you complete the configuration, select **Review ➕ create**
96+
97+
98+
### Contact us
99+
100+
If you're unable to resolve long latency issue, [email us](mailto:[email protected]) with the following information:
101+
102+
* Model Name
103+
104+
* Version
105+
106+
* Subscription ID
107+
108+
* Resource ID
109+
110+
* Timestamp and issue description
111+
112+
* Request IDs of the concerning operations (if possible)
113+
114+
* Logs
115+
116+
* Sample files
117+
118+
* JSON file (output/analyze results)
119+
120+
* Training set (if it's a training issue related to custom neural models)
121+
122+
123+
For more assistance, you can also or use the feedback widget at the bottom of any Microsoft Learn page.
126 KB
Loading
127 KB
Loading
166 KB
Loading
91.4 KB
Loading
137 KB
Loading

articles/ai-services/document-intelligence/toc.yml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ items:
5151
href: v21/sdk-overview-v2-1.md
5252
- name: Changelog and migration guide
5353
displayName: latest, update, beta, package, preview, version
54-
href: changelog-release-history.md
54+
href: changelog-release-history.md
5555
- name: Frequently asked questions (FAQ)
5656
displayName: storage, security, privacy, help, support, versions, development, migrate, migration, cognitive, applied, form recognizer, form, recognizer
5757
href: faq.yml
@@ -159,6 +159,9 @@ items:
159159
- name: Batch documents analysis
160160
displayName: analyze, azureBlobFileListSource, azureBlobSource, azureBlobFileListSource, resultContainerUrl, resultPrefix, overwriteExisting
161161
href: concept-batch-analysis.md
162+
- name: Troubleshoot latency issues
163+
displayName: latency, performance, slow, response, time, analyze
164+
href: concept/troubleshoot-latency.md
162165
- name: Quickstarts
163166
items:
164167
- name: Document Intelligence Studio custom projects
@@ -337,7 +340,7 @@ items:
337340
href: https://github.com/Azure-Samples/document-intelligence-code-samples/blob/main/schema/2024-11-30-ga/pay-stub.md
338341
- name: Receipt
339342
href: https://github.com/Azure-Samples/document-intelligence-code-samples/blob/main/schema/2024-11-30-ga/receipt.md
340-
- name: US tax W-2 form
343+
- name: US tax W-2 form
341344
href: https://github.com/Azure-Samples/document-intelligence-code-samples/blob/main/schema/2024-11-30-ga/us-tax/w2.md
342345
- name: US tax W-4 form
343346
href: https://github.com/Azure-Samples/document-intelligence-code-samples/blob/main/schema/2024-11-30-ga/us-tax/w4.md

0 commit comments

Comments
 (0)