apollographql / router

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

Send traffic to subgraphs via unix domain socket #3504

Closed alexhancock closed 6 months ago

alexhancock commented 1 year ago

(Filing this request after asking in Slack and being directed here by @lennyburdette)

Is your feature request related to a problem? Please describe. We have subgraphs we send traffic to by communicating with a sidecar via a unix domain socket. In the gateway this worked for us because we wrote a datasource using a networking package that supported this.

Describe the solution you'd like The ability to configure egress for certain subgraphs to be sent over a particular UDS.

Describe alternatives you've considered N/A

Additional context It looks like hyper::client doesn't directly support sending egress via UDS. In https://github.com/hyperium/hyper/issues/126 someone referenced a separate crate they developed that does support it https://github.com/softprops/hyperlocal

BrynCooke commented 1 year ago

We need to take a look at the impacts for supporting this across our tooling. Possibly we could supply a Router only feature as part of overriding subgraph URLs though.

@alexhancock Is the lack of this feature currently a blocker for you?

theJC commented 1 year ago

We havent done this yet, but were just ideating about doing this as well... our envoy sidecar is responsible for all the outgoing traffic to other services within our datacenter, so we were interested in seeing how much reduction of overhead we could obtain by transitioning subgraph requests over to using UDS rather than paying the cost of doing all network stack things to get the packets sent over to the sidecar on the same node in Kube.

abernix commented 11 months ago

Just coming by this issue to note that while this support is still not available, as of https://github.com/apollographql/router/releases/tag/v1.31.0, the Router supports HTTP2-over-Cleartext (H2C). @theJC, I know you probably know this since you're following that issue, but just sharing that context here, in case it is of interest to others since it is also capable of reducing overhead, if that is the motivation for the original author.

abernix commented 9 months ago

For folks still watching this issue, how relevant is this functionality for you? Is it something that you have seen proven wins for within the same Kubernetes host for other services?