Graph throttling
Microsoft's edit ·
Microsoft's commit message in microsoftgraph/microsoft-graph-docs-contrib · commit eafe3b0 · +17 −11 lines · also on GitHub
11
---
22
title: "Microsoft Graph throttling guidance"
3
−description: "Find best practices for maintaining optimal performance of the Microsoft Graph service if an overwhelming number of requests occurs."
3
+description: "Learn the best practices to avoid throttling and maintaining optimal performance should your app be throttled."
44
ms.localizationpriority: high
55
author: FaithOmbongi
66
ms.author: ombongifaith
7
−ms.reviewer: Luca.Spolidoro
7
+ms.reviewer: mariampo, Avinash.Chenoor
88
ms.subservice: non-product-specific
9
−ms.date: 01/22/2024
9
+ms.topic: overview
10
+ms.date: 01/14/2025
1011
ms.custom: graphiamtop20
1112
#Customer intent: As a developer integrating with Microsoft Graph, I want to understand how to avoid throttling and how to handle throttling when it occurs.
1213
---
1314
1415
# Microsoft Graph throttling guidance
1516
16
−Throttling limits the number of concurrent calls to a service to prevent overuse of resources. Microsoft Graph is designed to handle a high volume of requests. If an overwhelming number of requests occurs, throttling helps maintain optimal performance and reliability of the Microsoft Graph service.
17
+Throttling limits the number of concurrent calls to a service to prevent overuse of resources. The Microsoft Graph service implements throttling limits to ensure service availability and reliability.
1718
18
−Throttling limits vary based on the scenario. For example, if you are performing a large volume of writes, the possibility for throttling is higher than if you are only performing reads.
19
+Throttling limits vary based on the scenario. For example, if you're performing a large volume of writes, the possibility for throttling is higher than if you're only performing reads.
1920
2021
> [!NOTE]
2122
> Solutions that need to extract a large volume of data from Microsoft Graph should use [Microsoft Graph Data Connect](data-connect-concept-overview.md) instead of the Microsoft Graph REST APIs. Microsoft Graph Data Connect allows organizations to extract Microsoft 365 data in bulk without being subject to throttling limits.
⋯ 9 unchanged lines
3132
## What happens when throttling occurs?
3233
<!-- markdownlint-enable MD026 -->
3334
34
−When a throttling threshold is exceeded, Microsoft Graph limits any further requests from that client for a period of time. When throttling occurs, Microsoft Graph returns HTTP status code 429 (Too many requests), and the requests fail. A suggested wait time is returned in the response header of the failed request. Throttling behavior can depend on the type and number of requests. For example, if you have a high volume of requests, all requests types are throttled. Threshold limits vary based on the request type. Therefore, you could encounter a scenario where writes are throttled but reads are still permitted.
35
+When a throttling threshold is exceeded, Microsoft Graph:
36
+- Limits any further requests from that client app for some time.
37
+- Returns HTTP status code **429 Too Many Requests** and the requests fail.
38
+- Returns a suggested wait time in the response header of the failed request.
3539
40
+Throttling behavior can depend on the type and number of requests. For example, if you have a high volume of requests, all requests types are throttled. Threshold limits vary based on the request type. Therefore, you could encounter a scenario where writes are throttled but reads are still permitted.
41
+
3642
## Common throttling scenarios
3743
3844
The most common causes of throttling of clients include:
⋯ 38 unchanged lines
7783
7884
1. Wait the number of seconds specified in the `Retry-After` header.
7985
2. Retry the request.
80
−3. If the request fails again with a 429 error code, you are still being throttled. Continue to use the recommended `Retry-After` delay and retry the request until it succeeds.
86
+3. If the request fails again with a 429 error code, you're still being throttled. Continue to use the recommended `Retry-After` delay and retry the request until it succeeds.
8187
82
−All the resources and APIs described in the [Service-specific limits](throttling-limits.md) provide a `Retry-After` header except when noted.
88
+All the resources and APIs described in the [Service-specific limits](throttling-limits.md) provide a `Retry-After` header except where indicated.
8389
8490
For a broader discussion of throttling in the Microsoft Cloud, see [Throttling pattern](/azure/architecture/patterns/throttling).
8591
8692
> [!NOTE]
87
−> If no `Retry-After` header is provided by the response, we recommend implementing an exponential backoff retry policy. You can also implement [more advanced patterns](/azure/architecture/patterns/category/resiliency) when building large-scale applications.
93
+> If no `Retry-After` header is provided by the response, we recommend implementing an exponential backoff retry policy. You can also implement [more advanced patterns](/azure/well-architected/reliability/design-patterns) when building large-scale applications.
8894
>
8995
> Microsoft Graph SDKs already implement handlers that rely on the `Retry-After` header or default to an exponential backoff retry policy.
9096
9197
## Best practices to avoid throttling
9298
93
−Programming patterns like continuously polling a resource to check for updates and regularly scanning resource collections to check for new or deleted resources are more likely to lead to applications being throttled and degrade overall performances. You should instead leverage [change tracking](delta-query-overview.md) and [change notifications](change-notifications-overview.md) when available.
99
+Programming patterns like continuously polling a resource to check for updates and regularly scanning resource collections to check for new or deleted resources are more likely to lead to applications being throttled and degrade overall performances. You should instead use [change tracking](delta-query-overview.md) and [change notifications](change-notifications-overview.md) when available.
94100
95101
>[!NOTE]
96102
>[Best practices for discovering files and detecting changes at scale](/onedrive/developer/rest-api/concepts/scan-guidance) describes best practices in details.
⋯ 2 unchanged lines
99105
100106
[JSON batching](./json-batching.md) allows you to optimize your application by combining multiple requests into a single JSON object. Requests in a batch are evaluated individually against throttling limits and if any request exceeds the limits, it fails with a status code of `429` and an error similar to the [preceding sample response](#sample-response). The batch itself succeeds with a status code of `200` (OK). Multiple requests can be throttled in a single batch. You should retry each failed request from the batch using the value provided in the `retry-after` response header from the JSON content. You may retry all the failed requests in a new batch after the longest `retry-after` value.
101107
102
−If SDKs retry throttled requests automatically when they are not batched, throttled requests that were part of a batch are not retried automatically.
108
+If SDKs retry throttled requests automatically when they aren't batched, throttled requests that were part of a batch aren't retried automatically.
103109
104110
## Next step
105111
⋯ 2 unchanged lines
Microsoft's Markdown source from microsoftgraph/microsoft-graph-docs-contrib, © Microsoft Corporation, under CC BY 4.0. Changed lines with up to 3 unchanged lines around each; ChangeIntel kept this copy 10 Oct 09:39 UTC. The commit date is when the source changed, which can be hours or days before Learn published it.