router icon indicating copy to clipboard operation
router copied to clipboard

Add ability to configure subgraph keepalive duration

Open Meemaw opened this issue 2 years ago • 1 comments

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.

Meemaw avatar Feb 08 '23 16:02 Meemaw

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.

tonyfosterdev avatar Jun 05 '24 16:06 tonyfosterdev

We also have the same issue. Default keepAlive - 60s - is too large.

ernestaskardzys avatar Jan 03 '25 11:01 ernestaskardzys