title: Getting Axios Error: connect ETIMEDOUT when making high volume of calls
body: <p>I get this error when making a lot of calls from my Azure Function. What does this error mean? How to troubleshoot? My guess is I'm running out of TCP sockets? I don't really know how to check that in the Function App menu. However I checked the Logs for the Azure Maps API and there is no record of errors or dropped calls so I think it's definitely an axios/function issue.</p>
  <p>I have seen some suggestions to add <code>Connection:Keep-Alive</code> header or to even create an axios <code>instance</code> and reuse it. However I am not sure if my problem is even related to that.</p>
  <pre><code>Error: connect ETIMEDOUT 13.107.42.21:443
      at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1141:16) {   errno: 'ETIMEDOUT',   code: 'ETIMEDOUT',   syscall: 'connect',   address: '13.107.42.21',   port: 443,   config: {
      url: 'https://atlas.microsoft.com/search/fuzzy/json?api-version=1.0&amp;subscription-key= myKey &amp;query=myAddress USA',
      method: 'get',
      headers: {
        Accept: 'application/json, text/plain, */*',
        'x-ms-client-id': 'my client ID',
        'User-Agent': 'axios/0.19.2'
      },
      transformRequest: [ [Function: transformRequest] ],
      transformResponse: [ [Function: transformResponse] ],
      timeout: 0,
      adapter: [Function: httpAdapter],
      xsrfCookieName: 'XSRF-TOKEN',
      xsrfHeaderName: 'X-XSRF-TOKEN',
      maxContentLength: -1,
      validateStatus: [Function: validateStatus],
      host: 'atlas.microsoft.com',
      data: undefined   },   request: Writable {
      _writableState: WritableState {
        objectMode: false,
        highWaterMark: 16384,
        finalCalled: false,
        needDrain: false,
        ending: false,
        ended: false,
        finished: false,
        destroyed: false,
        decodeStrings: true,
        defaultEncoding: 'utf8',
        length: 0,
        writing: false,
        corked: 0,
        sync: true,
        bufferProcessing: false,
        onwrite: [Function: bound onwrite],
        writecb: null,
        writelen: 0,
        afterWriteTickInfo: null,
        bufferedRequest: null,
        lastBufferedRequest: null,
        pendingcb: 0,
        prefinished: false,
        errorEmitted: false,
        emitClose: true,
        autoDestroy: false,
        bufferedRequestCount: 0,
        corkedRequestsFree: [Object]
      },
      writable: true,
      _events: [Object: null prototype] {
        response: [Function: handleResponse],
        error: [Function: handleRequestError]
      },
      _eventsCount: 2,
      _maxListeners: undefined,
      _options: {
        protocol: 'https:',
        maxRedirects: 21,
        maxBodyLength: 10485760,
        path: '/search/fuzzy/json?api-version=1.0&amp;subscription-key= myKey &amp;query=myAddress%20USA',
        method: 'GET',
        headers: [Object],
        agent: undefined,
        agents: [Object],
        auth: undefined,
        hostname: 'atlas.microsoft.com',
        port: null,
        nativeProtocols: [Object],
        pathname: '/search/fuzzy/json',
        search: '?api-version=1.0&amp;subscription-key= myKey &amp;query=myAddress%20USA'
      },
      _redirectCount: 0,
      _redirects: [],
      _requestBodyLength: 0,
      _requestBodyBuffers: [],
      _onNativeResponse: [Function],
      _currentRequest: ClientRequest {
        _events: [Object: null prototype],
        _eventsCount: 6,
        _maxListeners: undefined,
        outputData: [],
        outputSize: 0,
        writable: true,
        _last: true,
        chunkedEncoding: false,
        shouldKeepAlive: false,
        useChunkedEncodingByDefault: false,
        sendDate: false,
        _removedConnection: false,
        _removedContLen: false,
        _removedTE: false,
        _contentLength: 0,
        _hasBody: true,
        _trailer: '',
        finished: true,
        _headerSent: true,
        socket: [TLSSocket],
        connection: [TLSSocket],
        _header: 'GET /search/fuzzy/json?api-version=1.0&amp;subscription-key= myKey &amp;query=myAddress%20USA HTTP/1.1\r\n' +
          'Accept: application/json, text/plain, */*\r\n' +
          'x-ms-client-id: my client ID\r\n' +
          'User-Agent: axios/0.19.2\r\n' +
          'Host: atlas.microsoft.com\r\n' +
          'Connection: close\r\n' +
          '\r\n',
        _onPendingData: [Function: noopPendingOutput],
        agent: [Agent],
        socketPath: undefined,
        method: 'GET',
        insecureHTTPParser: undefined,
        path: '/search/fuzzy/json?api-version=1.0&amp;subscription-key= myKey &amp;query=myAddress%20USA',
        _ended: false,
        res: null,
        aborted: false,
        timeoutCb: null,
        upgradeOrConnect: false,
        parser: null,
        maxHeadersCount: null,
        reusedSocket: false,
        _redirectable: [Circular],
        [Symbol(kCapture)]: false,
        [Symbol(kNeedDrain)]: false,
        [Symbol(corked)]: 0,
        [Symbol(kOutHeaders)]: [Object: null prototype]
      },
      _currentUrl: 'https://atlas.microsoft.com/search/fuzzy/json?api-version=1.0&amp;subscription-key= myKey &amp;query=myAddress%20USA',
      [Symbol(kCapture)]: false   },   response: undefined,   isAxiosError: true,   toJSON: [Function] }
  </code></pre>