API Gateway Websockets size limit Feedback

0

Why is the APi gateway websockets size limit so low (128k)?

This is pretty small, and frustrating.

Also, when you try and send too much data to the client, it didn't give me any errors the response just doesn't go through (lambda and websockets both logging a success).

It's a pretty cool service otherwise. Thanks for developing it!

7개 답변
1

This looks like a WS client issue. I tried with websockets (python), websocket-client (python) and wscat.

Working client : websocket and asyncio (python)

async def hello():
    uri = "wss://<api>.execute-api.us-west-2.amazonaws.com/<stage>/"
    async with websockets.connect(uri, ssl=ssl._create_unverified_context()) as websocket:
        name = "<some large msg>"

        await websocket.send(name)
        print(f"> large")

        greeting = await websocket.recv()
        print(f"< {greeting}")

Exception : websockets.exceptions.ConnectionClosedError: code = 1009 (message too big), reason = Message too big

Clients eating away the err code :
websocket-client (python)

def withWebSock():
    ws = websocket.WebSocket(sslopt={"cert_reqs": ssl.CERT_NONE})
    ws = create_connection(&#39;wss://<api>.execute-api.us-west-2.amazonaws.com/<stage>&#39;,
                           sslopt={"cert_reqs": ssl.CERT_NONE})
    ws.send("<some large msg>")
    print(ws.recv()) 

Exception : websocket._exceptions.WebSocketConnectionClosedException: Connection is already closed. No err code as such

wscat :

wscat -c wss://<api>.execute-api.us-west-2.amazonaws.com/<stage>/ -w 5 -x <some large msg>

Silently exits

AWS
답변함 4년 전
0

.

답변함 4년 전
0

API Gateway responds back with error code 1009 when it receives a larger frame or message as mentioned here - https://docs.aws.amazon.com/apigateway/latest/developerguide/limits.html.

I don't understand what you mean by "the response doesn't go through"? Do you mean the request doesn't go through to your lambda integration? What logs do you see for your API when you send a large message?

답변함 4년 전
0

That may be what the documentation says, but from what we've seen in our use, that is not the case and it doesn't reply at all (as mentioned in the original post)

dave-nm
답변함 4년 전
0

Agreed on the size limit. The websocket limit is 128k while the gateway HTTP limit is 10MB? I can imagine developers walking away from websockets over this limit alone.

My websocket will require my clients to implement multi-page request logic, as a very small percentage of requests will go over 128k.

답변함 4년 전
0

If AWS increased the WebSocket frame size for just the initial frame it would make a huge difference.

That way the 1st frame could contain a large request from the client, with the response(s) going back as the request was processed.

답변함 3년 전
0

The frame limit size of 32KB is unreasonably low and makes writing ANYTHING except a simple text chat application nearly impossible. I don't understand how this is justifiable given that AWS lambda has a payload size of 256KB, eight TIMES the size.

We are seriously considering dropping API gateway completely if this isn't resolved soon.

답변함 3년 전

로그인하지 않았습니다. 로그인해야 답변을 게시할 수 있습니다.

좋은 답변은 질문에 명확하게 답하고 건설적인 피드백을 제공하며 질문자의 전문적인 성장을 장려합니다.

질문 답변하기에 대한 가이드라인

관련 콘텐츠