Azure / Azure/azure-sdk-for-python

Azure AI Content Understanding (ACU) — Intermittent Timeout Errors with GPT-4.1-mini Custom Analyzer Model

Open
#47,942 6 comments 1 reaction 0 assignees View on GitHub
Client Cognitive - Content Understanding customer-reported needs-team-attention question
Dominant language
Python
Stars
5.6k
Forks
3.4k
Avg merge
1d 21h
Merged PRs (30d)
193

Description

- **Package Name**: `azure-ai-contentunderstanding`
- **Package Version**: `1.1.0`
- **Operating System**: Using Docker-image - `python:3.11-slim` with `k8s`
- **Python Version**: `3.11`

**Describe the bug**
We are using Azure AI Content Understanding(ACU) to extract structured data from documents. Requests are submitted asynchronously via the Python SDK (`begin_analyse`), and results are retrieved through polling on the returned `AsyncLROPoller`. When multiple documents are submitted for processing at around the same time, a subset of the ACU requests intermittently time out.
Resubmitting a timed-out file in isolation succeeds, and the response is typically returned within 10–12 seconds. This indicates the issue is not related to the content of any specific file, but rather to how the service behaves under concurrent load.

### Troubleshooting Performed -
We suspected the timeouts were caused by request concurrency (a "thundering herd" effect on the ACU service) and tried the following mitigations, none of which resolved the issue:
1. Increased the SDK polling interval from 1s to 5s to reduce polling load.
2. Increased the Tokens Per Minute (TPM) quota on the underlying `gpt-4.1-mini` deployment from _250K_ to _35M_ TPM.
3. Reduced the number of concurrent requests sent to ACU from 10 to 5 (this reduced but did not eliminate the errors, and increased overall processing latency), with exponential back-off retries.
4. Added random jitter to concurrent requests so they would not fire at the exact same time.
5. Added a rate-limiting mechanism to space out request submissions to ACU, with small randomized delays (0–200ms) between each request.

### Key Finding -
We changed the chat completion model used by the ACU analyzer from `gpt-4.1-mini` to `gpt-5.2` and `gpt-4.1`, and the timeout errors stopped occurring — under the same concurrency and request volume that previously produced timeouts.
This strongly suggests the root cause is specific to the `gpt-4.1-mini` deployment (or how ACU analyzers utilize that model), rather than general request concurrency on our end.

### Request to Azure Support -
Could you help us understand:
1. Whether there is a known issue or capacity constraint with ACU analyzers backed by `gpt-4.1-mini` under concurrent load.
2. Whether `gpt-4.1-mini` deployments used by ACU have different throughput/latency characteristics or throttling behavior compared to `gpt-5.2` / `gpt-4.1` that would explain this.
3. Any recommended configuration (deployment SKU, region, capacity type) to make `gpt-4.1-mini` reliable for this workload?

Contributor guide

Open the contributing guide

Research direction

Start with the azure-ai-contentunderstanding Python SDK 1.1.0 flow using begin_analyse and the returned AsyncLROPoller. Reproduce concurrent document submissions with gpt-4.1-mini, then compare polling and timeout behavior against gpt-5.2 and gpt-4.1 using the reported mitigations. Done means identifying whether the issue is in the SDK or service capacity and documenting a confirmed configuration or escalation path.

Written by the indexing model from the issue text.

Assessment

Tech stack
azure, python
Domain
api, backend
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Needs clarification
Newbie friendliness
32/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.