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`
Joe McDonald
09/21/2021, 8:54 PM
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.
Joe McDonald
09/21/2021, 8:59 PM
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
Bring your towel and join one of the fastest growing data communities. Welcome to our second-generation open source orchestration platform, a completely rethought approach to dataflow automation.