I'm using the Request module to fetch html pages, it works great but after some time I get errors ENOTFOUND
and EADDRINFO
on some of the requests. After looking around online I found some similar issues (#699, #5488, #697) and what I understand from it is that I'm probably not consuming some (or all?) of the responses and that at some point the app reaches the socket pool max size.
I'm not really sure about all that, but I'm thinking about increasing globalAgent.maxSockets
(to 100?) and always consuming the response by calling response.resume()
at the beginning of the request callback. Does any of that make sense ? Or am I way off the tracks ?
I've looked into Node's code to try to understand what resume()
does but I'm not sure I found the right function (#L698).
Thanks for your help.