9

This question is about two questions about JSON Batching

  1. I found out the batch limit is 15 instead of the mentioned 20, why is the limit not mentioned on the page of JSON Batching is a question to me. If I combine 15 requests they all succeed, no problem. If I do 16 to 20 requests they random start failing. I'm I doing something wrong? I'm not using the graph client because that didn't support batching for a long time. I also created a github issue about it, but it got closed for some reason.....
  2. How do I suggest the raising of the limit? It would be very useful if the limit could be raised to 50 (with the limitation that they should be in the same context, like you can add/remove 50 items from a single user calendar.)

The requests I'm trying to batch are a combination of these:

  • Remove item from users calendar
  • Add item to users calendar

It seems that some tenants (it's a multi tenant application) have a limit of 4, our tenant has a limit of 15 which seems the average.

If I go over the mentioned 20, I get a HTTP 400 Bad Request exception. But the batch requests with between 15 and 20 "subrequests" combined, produce a HTTP 200 Ok response, with some json describing the state of the subrequests. There the 429 status shows up.

{
    "id": "04",
    "status": 204,
    "headers": {
        "Cache-Control": "private"
    },
    "body": null
}

vs

{
    "id": "12",
    "status": 429,
    "headers": {
        "Retry-After": "1",
        "Cache-Control": "private"
    },
    "body": {
        "error": {
            "code": "ApplicationThrottled",
            "message": "Application is over its MailboxConcurrency limit.",
            "innerError": {
                "request-id": "b919dc35-78c1-407e-8f4a-0f44f03ac707",
                "date": "2019-10-08T20:03:44"
            }
        }
    }
}

@mag382 made a nice comment about this on the closed github issue.

This is definitely still a problem, and this issue should not have been marked closed. The batch endpoint won't return a BadRequest with 16-20 requests, but the response will have the ApplicationThrottled error. Something lower in the API is throttling the concurrency of mailbox access. Either that throttle needs to be increased to match the 20 request limit of the batch, or the batch documentation and validation needs to be brought down to 15.

Stephan
  • 2,356
  • 16
  • 38
  • 6
    To anyone at Microsoft that may follow StackOverflow: this is definitely an issue still. Stephan's description is quite accurate, and the response is exactly what you'll see if you submit a batch request from 16-20. – mag382 Mar 03 '20 at 18:38
  • 2
    This is still an issue. I'm using the Php Graph API and out of the 20 batched requests I send, I get 16 of them with the 429 error. I think this may have to do with the 4 concurrent request limit that probably SHOULD NOT apply to the batch requests. – Link May 08 '20 at 13:51
  • 1
    The effective batch limit with Outlook requests is even lower, 4, due to the number of concurrent requests for mailboxes: https://learn.microsoft.com/en-us/graph/throttling#outlook-service-limits – Haris Osmanagić Jun 04 '21 at 09:15
  • My question is about batching, the page describing batching doesn’t tell that all request in a batch still count against other service limits. And they added those limits (to the documentation), 2 years after my question. – Stephan Jun 04 '21 at 18:12

1 Answers1

0

The documentation mentions Outlook endpoints are limited to for Outlook

Bishop
  • 127
  • 2
  • 14
  • Thanks Bishop, you're right at this moment 3 years after the question it states that. Because I send a pull request for it. https://github.com/microsoftgraph/microsoft-graph-docs/pull/17078 – Stephan Aug 02 '22 at 14:53