A
A
AdNahim2022-04-01 08:14:58
Debian
AdNahim, 2022-04-01 08:14:58

Why does nodejs sometimes give ETIMEDOUT on requests after moving to another server?

The application worked for a long time on Ubuntu 16.04.6 LTS. Nodejs version 14.17.4
Number of cores - 1, RAM - 1 GB

moved recently. Debian 11, it became 2 cores of 2000 Hz, RAM - 4 GB, the node version is the same as 14.17.4

Now I began to notice that when making requests to third-party services (API), (request or request-promise) it gives an error:

{"name":"RequestError","message":"Error: connect ETIMEDOUT <ip стороннего сервиса>...

Such an answer is not permanent, sometimes the answer comes right, which is what is required.

At the moment of such an error, I tried to trace to the ip of a third-party API (for example 5.4.3.2), the result is this:

traceroute to 5.4.3.2 (5.4.3.2), 30 hops max, 60 byte packets
 1  serrv2422vps (80.187.14.36)  0.059 ms  0.034 ms  0.038 ms
 2  * * *
 3  * * *
 4  * * *


Do not tell me in which direction it is worth looking and what is this knitted with? Of course, from the third-party service they assure that the problem is not with them. And the very fact of moving to another server seems to confirm this, since the problems began after this move.

I googled something with UV_THREADPOOL_SIZE, but I'm not sure yet how and where it's better to change this parameter and whether it's worth it.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
R
res2001, 2022-04-01
@res2001

Timeout when calling connect. This is, in principle, normal and quite likely in any network applications. This may indicate the unavailability of the remote side or poor communication quality.
A common response to such an error would be to retry the operation or terminate the application with an error.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question