apollographql / router

A configurable, high-performance routing runtime for Apollo Federation 🚀
https://www.apollographql.com/docs/router/
Other
812 stars 273 forks source link

Add ability to configure subgraph keepalive duration #2577

Open Meemaw opened 1 year ago

Meemaw commented 1 year ago

Describe the solution you'd like The router sets a keepalive with duration of 60s for subgraph requests. This seems like a very aggressive default, which should be configurable to say the least.

This needs to be tuned for different environment to not end up with dead connections.

I would also suggest to be more conservative here, and change the default to something like 5s (which is what NodeJS uses for example).

https://github.com/apollographql/router/blob/8c5f90330d0bc18adc8d4f1c6e5b462fc398c12d/apollo-router/src/services/subgraph_service.rs#L119

Describe alternatives you've considered N/A

Additional context Add any other context or screenshots about the feature request here.

tonyfosterdev commented 5 months ago

My team has been dealing with issues around this as well. See this article: https://medium.com/@_alif/aws-elb-5xxs-revisit-your-server-keepalivetimeout-a0ea8e22c242

Basically it details issues between AWS load balancers and processes with keep alive settings that aren't really compatible. Being able to modify this and the headers timeout would be super helpful.