https://prefect.io logo
j

Joe McDonald

09/21/2021, 8:43 PM
Any Apollo maintainers here? Having issues behind ELB of occasional 502 errors, this seems to be similar to the issue I encounted with graphql, where the default framework keep alive timeout is set lower than what AWS ALB ELB uses, causing connection reset issues when the timing is right… This article explains the issue and fix: https://shuheikagawa.com/blog/2019/04/25/keep-alive-timeout/ Be sure to look at the updated part at the bottom setting:
Copy code
server.keepAliveTimeout = 61 * 1000;
server.headersTimeout = 65 * 1000; // This should be bigger than `keepAliveTimeout + your server's expected response time`
I’d be happy to help find a good way to do this an open a PR, but didn’t see repo in PrefectHQ so assumed it was private.
I believe setting an env variable, and if that variable exist, apply it…forgive me if my node.js is bad…
Copy code
if ('KEEPALIVE_TIMEOUT' in process.env) {
  server.keepAliveTimeout = process.env.KEEPALIVE_TIMEOUT * 1000;
  server.headersTimeout = (process.env.KEEPALIVE_TIMEOUT + 5) * 1000;
}
c

Chris White

09/21/2021, 9:58 PM
Hey @Joe McDonald - the apollo configuration and setup for Prefect Server can be found here: https://github.com/PrefectHQ/server/tree/master/services/apollo feel free to poke around and open a PR! If you have any questions feel free to ask in the server channel or in #prefect-contributors
👀 1
👍 1
j

Joe McDonald

09/21/2021, 11:52 PM
c

Chris White

09/21/2021, 11:55 PM
wow that was fast! thanks for the PR, we'll review soon
2 Views