googlemaps / js-route-optimization-app

Solve vehicle routing problems with Google Optimization AI Cloud Fleet Routing
https://cloud.google.com/optimization/
Other
93 stars 25 forks source link

Large response bodies can exceed Cloud Run's response limit #61

Open jmccollum-woolpert opened 1 year ago

jmccollum-woolpert commented 1 year ago

Cloud Run has a hard response body limit of 32MiB. If this limit is reached, the response is blocked and a 500 error is thrown. On the frontend, this can display as a "500 OK" error. Should investigate alternative ways of delivering large solutions or at least throwing a more helpful error to the frontend.

cmorabito-woolpert commented 1 year ago

To get around that limit, we'd have to use HTTP2 and potentially do some work on the backend to chunk/stream the response.

Configuring Cloud Run to use HTTP2 is trivial, but when I tried I got "too many redirects" errors after the Google Account sign in. So there's probably more to do there with Load Balancer/IAP/etc. to enable HTTP2 through the request path.

jmccollum-woolpert commented 1 year ago

Will also want to think about how this impacts the frontend. Solutions this size may be pushing the memory limits of a single tab.