Increasing max size of response for requests that are passed through json transcoding

952 views
Skip to first unread message

Mads Andreasen

unread,
Sep 21, 2020, 2:10:46 PM9/21/20
to Google Cloud Endpoints
Hi all,

I have a question regarding the maximum size for json-transcoded responses. I am running a ESPv2 gateway in front of several other grpc containers, with json transcoding enabled.

This works like a charm for the most part. But whenever the json response is larger than 1mb, the endpoints starts returning empty responses.

The status code returned by the gateway is still 200 , but content length is 0, and the payload is just "null". The backend grpc server (which processes the request routed by the ESPv2 gateway) also reports is a 200 response.

When accessing the gateway using GRPC client instead of REST/JSON i get the full response, even though it is larger than 1mb. This is also the case if I hit the backend server directly via GRPC.

This makes me suspect that the issue is some kind of maximum response or buffer size limit that is present inside the Envoy service in connection with the JSON transcoding.

I found this similar issue for envoy on github: https://github.com/envoyproxy/envoy/issues/6441
Here they mention a connection parameter called per_connection_buffer_limit_bytes which can be increased. However I cannot find anything about this parameter in either the espv2 documentation or the espv2 source code.

I have set up a demo endpoint to illustrate the issue. It is a simple endpoint that return a json response with a line of text that is repeated x times. 


This works  fine when the response is small, but when the response grows beyond 1mb, then the endpoint starts returning empty responses with zero length, like this:


I put the espv2 gateway container in debug mode, and here is the output. This log dump contains the logs for both a "good" request that contained json response,  and a "bad" response that did not contain any response body.

Can anyone advise on how I can increase the buffer limit/response size limit for the espv2 json transcoder to allow for returning larger payloads (10-20mb)?

Best Mads
null__logs__2020-09-21T08-01.csv

Wayne Zhang

unread,
Sep 21, 2020, 2:26:57 PM9/21/20
to Mads Andreasen, Google Cloud Endpoints
Could you file an issue here?  If it is just a `per_connection_buffer_limit_bytes` setting,  we can add a flag for you to set it. 

--
You received this message because you are subscribed to the Google Groups "Google Cloud Endpoints" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-cloud-endp...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-cloud-endpoints/6aadbdd0-9dcf-40fd-a8a0-99200aeea372n%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages