Unknown reason for API Gateway WebSocket LimitExceededException
The only documentation we've been able to find that may be related to this limit is the account level quota of 10,000 per second (and we're not sure if that's the actual limit we should be looking at). If that is the limit, the problem then is that we are nowhere near it. For a single deployed API we're hitting a maximum of 3000 messages sent through the socket per minute with an overall account total of about 5000 per minute. So nowhere near the 10,000 per second.
The only thing we think may be causing it is we have a "large" number messages going through the socket relative to the number of connected clients. For the api that's maxing at about 3000 messages per minute, we usually have 2-8 connected clients. Our only guess is there may be a lower limit to number of messages per second we can send to a specific socket connection, however we cannot find any docs on this.
Thanks for any help anyone can provide
LimitExceededException - The client is sending more than the allowed number of requests per unit of time or the WebSocket client side buffer is full.
In your case the client refers to the Lambda that is calling postToConnection API.... there is a limit at which this API can be invoked per second... once we go beyond the limit thats when it results in the LimitExceededException. https://docs.aws.amazon.com/AWSJavaSDK/latest/javadoc/com/amazonaws/services/apigatewaymanagementapi/AmazonApiGatewayManagementApi.html#postToConnection-com.amazonaws.services.apigatewaymanagementapi.model.PostToConnectionRequest-
Note: Request rate limit of postToConnection is unknown as we couldn't find related documentation.
Possible Solution: Check the response from postToConnection if it results in LimitExceededException then retry by waiting for few hundred milliseconds. Best practice is to apply exponential backoff with jitter https://aws.amazon.com/blogs/architecture/exponential-backoff-and-jitter/
Client API throttling in API GatewayAccepted Answerasked 2 years ago
Is websocket api is protected by AWS WAF ?asked 2 years ago
API Gateway Websocket - payload quotasasked 3 months ago
Referencing websocket api id in serverless templateasked 3 years ago
Websoket with API Gateway, ECS and VPC linkasked a month ago
API Gateway Websocket sigv4 ahthenticationAccepted Answerasked 3 years ago
Unknown reason for API Gateway WebSocket LimitExceededExceptionasked 2 months ago
Trying to use a single Amazon API Gateway endpoint to accept both HTTP and websocket requestsAccepted Answerasked 2 years ago
Max connection limit for websocket?asked 3 years ago
Are API Gateway Websocket APIs treated as asynchronous?asked 2 years ago