APIM throttles only web socket requests, not REST Apis.

pratik 46 Reputation points


I am using API Management service to route Rest and web socket request to AKS and Pubsub service respectively. APIM is used to authenticate all incoming requests and it is standard tier of APIM.

In last couple of months, I have observed that only web socket APIs are being throttled on APIM. Rest APIs are working fine. I am not getting any logs on Pubsub service and in App Insights I am getting

Backend connections is being throttled. Please scale service to allow more connections.  

with response code 429.

I checked through Alerts configured on APIM. But there are not even 10-15 requests or connections.

Is there anyway I could clear-off socket connections from API or at least know how many connections are active at present?

Azure API Management
Azure API Management
An Azure service that provides a hybrid, multi-cloud management platform for APIs.
1,878 questions
Azure Web PubSub
Azure Web PubSub
An Azure service that provides real-time messaging for web applications using WebSockets and the publish-subscribe pattern.
71 questions
{count} votes

Accepted answer
  1. JananiRamesh-MSFT 23,001 Reputation points

    Hi @pratik Thanks for reaching out. This seems to be an ongoing issue from the product end. The fix will be rolled out in 2-4weeks from now but Rebooting the APIM VMs is the only workaround we can apply for now.

    RCA: Issue is that there were cases where a close socket event was invoked on an active websocket channel if the websocket was processing of msg received events. This would lead to cases where if the receive event was cancelled, the cancellation event is not being propagated to the close connection event, even when the same cancellation token was passed. In order to mitigate the issue, we added a handler to forcibly close the websocket connection on a close event to ensure connections are closed.

    let me know incase of further queries, I would be happy to assist you.

    Please 'Accept as answer' and ‘Upvote’ if it helped.
    Accepting answers will help increase the visibility of this question and the solution for anyone else who may run into the same issue. Thank you for helping to improve Microsoft Q&A!

0 additional answers

Sort by: Most helpful