5

I am using request npm module and making upstream requests in a loop approx 100 requests per second. The timeout has been set to 10 seconds. Problem is I keep getting ESOCKETTIMEDOUT for 1 out of 1000 requests consistently.

I am pretty sure that upstream server is not timing out. What could be the reason of this and how to avoid it.

user27111987
  • 995
  • 2
  • 10
  • 26
  • http://stackoverflow.com/q/20253425/1005215 – Nehal J Wani Mar 12 '17 at 08:38
  • I don't want to limit , I just want to understand the reason for this error. Is the issue at my end and or the upstream server. – user27111987 Mar 14 '17 at 16:48
  • Do you control the upstream server? If not, there might be some throttling mechanism to avoid DoS attacks on the served side. If you want to throttle your requests from client side, you may wanna look into that. – Nehal J Wani Mar 15 '17 at 02:57
  • No I don't control the upstream server. I just want to understand first why am I getting this , due to upstream server or due to a issue at my end. Throttling is one option I know , but before I do it I want a full understading. – user27111987 Mar 16 '17 at 17:54
  • 1
    The upstream server is probably rate limiting your requests. – Nehal J Wani Mar 16 '17 at 18:10
  • see my answer here for a solution: https://stackoverflow.com/questions/35387264/node-js-request-module-getting-etimedout-and-esockettimedout – cancerbero Nov 05 '17 at 20:11
  • I also faced it and I found this [issue](https://github.com/request/request/issues/2676) It was opened 11 days ago – Denys Medvediev Jun 14 '17 at 14:44

0 Answers0