How does limit concurrency works in azure APIM

Suresh Thakur, Kirti 86 Reputation points
2022-02-07T05:03:06.177+00:00

This is what i am trying to set in policy
<backend>
<limit-concurrency key="@(context.Request.IpAddress)" max-count="10" max-queue-length="100">
<forward-request />
</limit-concurrency>
</backend>

I want to know below questions

  1. What happens when request exceeds the max count ? will the 11th request be retry ?
  2. To queue the request and shoot them after concurrency period i amd setting max-queue-length and i am getting below error

171752-image.png

Azure API Management
Azure API Management
An Azure service that provides a hybrid, multi-cloud management platform for APIs.
2,447 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. MughundhanRaveendran-MSFT 12,506 Reputation points
    2022-02-08T13:45:39.643+00:00

    @Suresh Thakur, Kirti ,

    Thanks for reaching out to Q&A.

    The limit-concurrency policy prevents enclosed policies from executing by more than the specified number of requests at any time. Upon exceeding that number, new requests will fail immediately with 429 Too Many Requests status code. So the 11th request will fail with status code 429.

    In order to resolve the max-queue-length error, please try to set a timeout attribute in between max-count and max-queue-length.

    <limit-concurrency key="expression" max-count="number" timeout="in seconds" max-queue-length="number">
    <!— nested policy statements -->
    </limit-concurrency>

    I hope this helps!

    Please 'Accept as answer' and ‘Upvote’ if it helped so that it can help others in the community looking for help on similar topics.


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.