GameLift Server SDK5 WebSocket returning throttling errors on InitSDK() call

0

I am using GameLift through the Go version of Server SDK5. When I instantiante the fleet with 50 game server processes on an instance (there is only one instance), I get this error in game server process logs :

2023/05/03 09:56:02.812774 websocket.go:55: [DEBUG]:Response header is: map[Content-Length:[113] Content-Type:[application/json; charset=UTF-8] Date:[Wed, 03 May 2023 09:56:02 GMT] Via:[1.1 ffe68b4a5d64737b8a3ccde75553a7ac.cloudfront.net (CloudFront)] X-Amz-Apigw-Id:[EVxj9F6WjoEFufA=] X-Amz-Cf-Id:[TYcHtwXIHyFPVlBRLHFuptYeLk7tueWkCyUj7Iuyqf20C2eK2u2lNQ==] X-Amz-Cf-Pop:[DUB56-P1] X-Cache:[Error from cloudfront]]
2023/05/03 09:56:02.812782 websocket.go:56: [DEBUG]:Response body is: {"Action":"$connect","RequestId":"$connect","StatusCode":429,"ErrorMessage":"ThrottlingException: Rate exceeded"}
2023/05/03 09:56:02.812795 gamelift.go:61: GameLift InitSDK failed with error : [GameLiftError: ErrorType={19}, ErrorName={Local connection failed.}, ErrorMessage={[GameLiftError: ErrorType={24}, ErrorName={WebSocket Connection Failed}, ErrorMessage={connection error 429 Too Many Requests:websocket: bad handshake}]}]

It seems that the WebSocket server is throttling the connections because there are too many at a time. GameLift creates and runs all 50 processes of game servers within a timeframe of 50 milliseconds , each process then calls the SDK function gameLiftServer.InitSDK(), and so throttling happens. As a result, we have to do random sleeps to avoid the processes calling InitSDK() at the same time, and retrying if the call still fails with a 429 error.

Is that normal behavior ? With SDK4, we did the same thing, same number of calls, and no errors happened. Is there a way to increase the throttling maximums on the GameLift WebSocket server side ?

1 Respuesta
0

Thanks for bringing this to our attention. This is something we're looking into currently, but in the meantime I would suggest implementing a backoff and retry strategy with jitter to ensure your calls aren't getting throttled. If you'd like to track this with the service team please make sure to cut a customer support case.

Thanks!

AWS
respondido hace un año

No has iniciado sesión. Iniciar sesión para publicar una respuesta.

Una buena respuesta responde claramente a la pregunta, proporciona comentarios constructivos y fomenta el crecimiento profesional en la persona que hace la pregunta.

Pautas para responder preguntas