You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In Apollo Gateway, the default fetcher that the RemoteGraphQLDataSource uses doesn't configure a Node.js http.Agent with the keepAlive: true option. This means that the default behavior is to destroy the underlying TCP sockets when there are not active connections rather than maintaining a pool of established connections.
The current default fetcher in Apollo Gateway is node-fetch. Some alternative fetchers support having keep-alive on by default, but it's also possible to configure node-fetch to have this option enabled by default, as documented in their documentation.
We've found a number of reasons in the past to recommend make-fetch-happen — notably it's out of the box support for proxies, conditional cache control headers, gzip/deflate support, and its request pooling. We should:
Evaluate whether it's feasible to change our default fetcher to make-fetch-happen, which solves this. This is a bit of a larger change and something we've punted before. This is actually tracked in Apollo Gateway: Add make-fetch-happen fetcher as the default fetcher for the downstream services #192, so if we take that approach (which has some comments with reading on it and its own associated references!), we may be able to just close this issue as resolved.
If that approach is deemed too large, we may want to just keep the default fetcher as node-fetch but configure it to use keepAlive: true.
The text was updated successfully, but these errors were encountered:
In Apollo Gateway, the default fetcher that the
RemoteGraphQLDataSource
uses doesn't configure a Node.jshttp.Agent
with thekeepAlive: true
option. This means that the default behavior is to destroy the underlying TCP sockets when there are not active connections rather than maintaining a pool of established connections.The current default fetcher in Apollo Gateway is
node-fetch
. Some alternative fetchers support having keep-alive on by default, but it's also possible to configurenode-fetch
to have this option enabled by default, as documented in their documentation.We've found a number of reasons in the past to recommend
make-fetch-happen
— notably it's out of the box support for proxies, conditional cache control headers, gzip/deflate support, and its request pooling. We should:make-fetch-happen
, which solves this. This is a bit of a larger change and something we've punted before. This is actually tracked in Apollo Gateway: Add make-fetch-happen fetcher as the default fetcher for the downstream services #192, so if we take that approach (which has some comments with reading on it and its own associated references!), we may be able to just close this issue as resolved.node-fetch
but configure it to usekeepAlive: true
.The text was updated successfully, but these errors were encountered: