Re: [nodejs] NodeJS - { [Error: socket hang up] code: 'ECONNRESET' }

5,180 views
Skip to first unread message

Harald Hanche-Olsen

unread,
Jan 14, 2013, 2:02:40 PM1/14/13
to nod...@googlegroups.com, bur...@gmail.com
[<bur...@gmail.com> (2013-01-14 18:41:11 UTC)]

> Hi,
>
> i'm getting data via http get method Node JS but i get this error often "{
> [Error: socket hang up] code: 'ECONNRESET' }" error on console.
>
> What do you think the problem?

Without further information, I'd assume that the remote end has closed
the connection unexpectedly, without reading data that was sent to it.

See for example here:

http://stackoverflow.com/questions/2974021/what-does-econnreset-mean-in-the-context-of-an-af-local-socket

- Harald

Murvin Lai

unread,
Jan 15, 2013, 6:10:35 PM1/15/13
to nod...@googlegroups.com, bur...@gmail.com
 I did a lot of remote calls in my last project, usually the connection reset is caused by your own server limitation or remote server capacity.  

for remote server, nothing u can do.  for your own node server, you should check several things like ulimit, and set maxSockets.  see tips  from my site: 





--
Job Board: http://jobs.nodejs.org/
Posting guidelines: https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
You received this message because you are subscribed to the Google
Groups "nodejs" group.
To post to this group, send email to nod...@googlegroups.com
To unsubscribe from this group, send email to
nodejs+un...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/nodejs?hl=en?hl=en

bur...@gmail.com

unread,
Jan 16, 2013, 4:22:02 PM1/16/13
to nod...@googlegroups.com
Thanks for answer. Right now i'm using Node-Curl. In tests i've been made, node-curl doesn't close connection but http.get closes. Did you ever use node-curl? Do you know any difference between Node-Curl and http.request?

Murvin Lai

unread,
Jan 17, 2013, 2:41:40 PM1/17/13
to nod...@googlegroups.com
I took a look of node-curl.  It build from its own source code, not depending on node's http.request  

Since I haven't used node-curl nor did any load testing on this, I cannot say how good it is under stress.  also, I don't know how this node-module handles socket / connection management.

I used http.request before with a lot of load testing and real time massive traffic.  So, I can say that one is reliable when you have everything set correctly.  Of course, it requires bit more coding.

If you plan to use node-curl or any other modules, I will suggest you to do a lot of load testings, watch the CPU , memory and socket pool,  and see if it meets your requirement.  I usually do the test by remotely connect to google recaptcha and another node server created by myself in another box - a simply server  just have app.get(/*,...)   So you have two set of numbers to compare. 




On Wed, Jan 16, 2013 at 1:22 PM, <bur...@gmail.com> wrote:
Thanks for answer. Right now i'm using Node-Curl. In tests i've been made, node-curl doesn't close connection but http.get closes. Did you ever use node-curl? Do you know any difference between Node-Curl and http.request?

--

Burak Gürbüz

unread,
Jan 20, 2013, 3:43:51 PM1/20/13
to nod...@googlegroups.com
I'll go with the steps you told.

Thanks for informations you gave.

17 Ocak 2013 Perşembe 21:41:40 UTC+2 tarihinde murvinlai yazdı:
Reply all
Reply to author
Forward
0 new messages