Microsoft OneDrive Service Limit Throttling

Kartik Anil Reddy 1 Reputation point
2023-05-04T13:38:01.0933333+00:00

I have a sandbox developer account for testing which has 10,001 licenses. Based on the documentation (https://learn.microsoft.com/en-us/sharepoint/dev/general-development/how-to-avoid-getting-throttled-or-blocked-in-sharepoint-online) I should be allowed to make 1800 List Drive (3600 Resource Units) requests within a minute. However I get throttled at approximately 1600-1700 requests. The overall graph API limits are 2000 requests per second which I am definitely below. Further in the documentation referenced above, it is indicated that if there is no RateLimit-Limit header, it means that I have hit another limit.

Here are my questions:

  • How do I identify what limit I have reached?
  • When I hit 80% quota, I see the response headers show that RateLimit-Limit is 1250 - Why is this lower than the expected 3600 Resource Units?
  • Are there any other limits aside from the 2000 requests per second per app across tenants and the graph API limits that I am missing?

All my code does is use an existing bearer token to list drives for a single resource 1800 times using the Graph API. Here are the sample from the requests that return 429:

Response Body

{
    "error":
        {
            "code": "activityLimitReached",
            "message": "The request has been throttled",
            "innerError":
                {
                    "code": "throttledRequest",
                    "innerError": { "code": "quota" },
                    "date": "2023-05-04T13:07:14",
                    "request-id": "7369b9b1-a8ac-4708-a254-ba80e04f2cb8",
                    "client-request-id": "7369b9b1-a8ac-4708-a254-ba80e04f2cb8",
                },
        },
}

Response Headers

		cache-control=[private], 
        client-request-id=[7369b9b1-a8ac-4708-a254-ba80e04f2cb8], 
        content-type=[application/json], 
        date=[Thu, 04 May 2023 13:07:13 GMT], 
        request-id=[7369b9b1-a8ac-4708-a254-ba80e04f2cb8], 
        retry-after=[5], 
        strict-transport-security=[max-age=31536000], 
        transfer-encoding=[chunked], 
        x-ms-ags-diagnostic=[{"ServerInfo":{"DataCenter":"West 	US","Slice":"E","Ring":"4","ScaleUnit":"003","RoleInstance":"SJ1PEPF00001397"}}]
Microsoft Graph
Microsoft Graph
A Microsoft programmability model that exposes REST APIs and client libraries to access data on Microsoft 365 services.
10,909 questions
OneDrive
OneDrive
A Microsoft file hosting and synchronization service.
878 questions
{count} votes

1 answer

Sort by: Most helpful
  1. Antonio 250 Reputation points Microsoft Vendor
    2023-05-04T16:37:40.8966667+00:00

    Hi Kartik Anil Reddy,

    As the exact code implementation was not mentioned. I'd first like to mention to be sure to use multiple requests in one HTTP call using JSON batching. This will greatly mitigate potential throttling issue from occurring. As Each individual request can be tested with try...retry to avoid processing delays.

    Please Note some limitations in JSON batch processing.

    • How do I identify what limit I have reached?
      • We currently have a new preview product Microsoft Graph Developer Proxy v0.7 which allows you to simulate behaviors on any API. using a list of API URLs to simulate errors (including throttling & server issues).
    • When I hit 80% quota, I see the response headers show that RateLimit-Limit is 1250 - Why is this lower than the expected 3600 Resource Units?
      • Note that *RateLimit *headers are currently in beta and subject to change so it may not always be accurate.
      • RateLimit headers - preview (It's from SPO however it's the same source to calculate the rate)

        The RateLimit headers are returned on a best-efforts basis, so applications may not receive the headers under all conditions. Additionally, there are other limits that aren't presented in the RateLimit headers, so applications can get throttled even before reaching the limit described in the RateLimit headers. Below is the list of limits that we support the RateLimit headers for. The policies and values are subject to change:

    • Are there any other limits aside from the 2000 requests per second per app across tenants and the graph API limits that I am missing?
      • Please note that rate specific limits can be reference here.

    You can further review the Application Throttling documentation and any feedback or updates for that page can be submitted via feedback.

    One last item for consideration solutions that need to extract a large volume of data from Microsoft Graph should use Microsoft Graph Data Connect 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.

    --please don't forget to upvote and Accept as answer if the reply is helpful--