---
title: "How do I Fix ERR_SOCKET_TIMEOUT Error on Apollo Gateway"
canonical: "https://support.apollographql.com/space/ETKB/654966877/How%20do%20I%20Fix%20ERR_SOCKET_TIMEOUT%20Error%20on%20Apollo%20Gateway"
format: markdown
---
On an Apollo Gateway with high traffic, you might encounter the following error:

```
{
    code: ERR_SOCKET_TIMEOUT,
    timeout: 4000,
    type: system,
    errorType: FetchError
    formattedErrorMessage: reason: Socket timeout
}

```

This is caused by the default connection pooling limit set in `make-fetch-happen`, a library that Apollo Gateway uses for HTTP requests. The default limit for older versions of the library is 15 connections.

To fix this error, please update your `@apollo/gateway` package to v0.51.0 or later (or v2.0.2+ if you're using Federation 2.x). These versions remove the connection limit entirely and will resolve this issue.

## Setting a connection limit manually

If needed, you can set a connection limit manually by creating a `fetcher` object with the `make-fetch-happen` library, and pass that `fetcher` into the gateway `buildService`.

```
import fetcher from 'make-fetch-happen';

const lowConcurrencyFetcher = fetcher.defaults({ maxSockets: 15 });

const gateway = new ApolloGateway({
  buildService({ url }) {
    return new RemoteGraphQLDataSource({
      url,
      fetcher: lowConcurrencyFetcher,
    });
  },
});
```