Retry-After header upper limit or range

Aaditya Rane 51 Reputation points
2021-12-02T07:58:46.897+00:00

Scenario:

We were doing some heavy operations using Microsoft Graph and SharePoint APIs.
Ans as usual due to heavy operations we received 429 (Throttling) in the response.

But from previous experience, we had seen 'Microsoft Graph API' sends max 10-20s in 'retry-after' header. 'SharePoint API' had send up to 300s in 'retry-after' header.

But recently we have observed 'Microsoft Graph API' also sending 'Retry-After' header with high values.

Observations:

POST: "https://graph.microsoft.com/v1.0/drives/b!ctJlw490OkqH_ufKvIEcTSpVGwxmsGBLkHcQ2rjccZDzO2uAcpHkR5fGeT1QfF-F/items/01AWX3RQYDMEEOQFRILRDISIANYH4OIPZ2?$select=sharepointids"
RESPONSE:
Hitting endpoint for 1st Time
http-response: 429 Too Many Requests 

headers: 
'Retry-After' : 41

response-body:
{
    "error": {
        "code": "activityLimitReached",
        "message": "The request has been throttled",
        "innerError": {
            "code": "throttledRequest",
            "innerError": {
                "code": "quota"
            },
            "date": "2021-11-30T12:17:46",
            "request-id": "01c3bdb8-fbb1-4613-96ad-be961ba99e11",
            "client-request-id": "01c3bdb8-fbb1-4613-96ad-be961ba99e11"
        }
    }
}
RESPONSE:
Hitting endpoint for 2nd Time
http-response: 429 Too Many Requests 

headers: 
'Retry-After' : 315

response-body:
{
    "error": {
        "code": "activityLimitReached",
        "message": "The request has been throttled",
        "innerError": {
            "code": "throttledRequest",
            "innerError": {
                "code": "quota"
            },
            "date": "2021-11-30T12:18:27",
            "request-id": "d4e33010-58e5-4dca-bb75-a340505e5c45",
            "client-request-id": "d4e33010-58e5-4dca-bb75-a340505e5c45"
        }
    }
}

Question:

As you can see from above observations 'Retry-After' header received is '41' and '315' respectively, which are too huge.
Is there any range how high this can go, or some insides how exactly this 'Retry-After' header is determined ?

Microsoft Graph
Microsoft Graph
A Microsoft programmability model that exposes REST APIs and client libraries to access data on Microsoft 365 services.
12,501 questions
SharePoint Development
SharePoint Development
SharePoint: A group of Microsoft Products and technologies used for sharing and managing content, knowledge, and applications.Development: The process of researching, productizing, and refining new or existing technologies.
3,119 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. RaytheonXie_MSFT 36,576 Reputation points Microsoft Vendor
    2021-12-03T02:16:20.197+00:00

    Hi @Aaditya Rane ,
    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. Here is a document for Microsoft Graph throttling guidance
    https://learn.microsoft.com/en-us/graph/throttling#service-specific-limits


    If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.



Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.