Skip to content Skip to sidebar Skip to footer

Requesterror: Error: Connect Econnreset 127.0.0.1:8443

I'm querying 127.0.0.1:8443 via request-promise in NodeJS with 10K+ requests and are hitting: { RequestError: Error: connect ECONNRESET 127.0.0.1:8443 and/or { RequestError: Error

Solution 1:

As per Node.js documentation:

ECONNRESET (Connection reset by peer): A connection was forcibly closed by a peer. This normally results from a loss of the connection on the remote socket due to a timeout or reboot. Commonly encountered via the http and net modules.

Since a large number of requests are hitting the server, it is getting overloaded (busy servicing previous requests before it can handle any new request).

Possible solutions:

  • Check/modify server timeout using server.timeout = 0. This is not a recommended solution for production. However, it can help you in development/testing.

  • You can increase the maximum number of allowed connections using server.maxConnections but this too is not a recommended solution for production. However, it will allow you to verify whether the server hardware capacity needs to be upgraded or the network bandwidth needs upgrade. If your server is in a good datacenter, usually it is the hardware capacity that needs to be upgraded (see next two solution).

  • If you are using a cloud server, increase the number of cores so that requests can be services faster.

  • Consider load sharing by having more than one instance of the server (behind a load balancer).

Post a Comment for "Requesterror: Error: Connect Econnreset 127.0.0.1:8443"