bench-rest icon indicating copy to clipboard operation
bench-rest copied to clipboard

Socket hang up

Open omesanni opened this issue 9 years ago • 3 comments

I always get this error 'Failed in main with err: { [Error: socket hang up] code: 'ECONNRESET' }' anytime i run my bench rest script. I don't really understand why.

Basically the end point I am using bench rest to load carries out some asynchronous tasks. So I looping through any array and I am creating some users in my database and so no response will be sent until that array has completed. Do you think this is the reason why it is hanging up?

omesanni avatar Feb 17 '16 16:02 omesanni

It's hard to say what is causing this, could be anything from a timeout to the service crashing.

If none of the iterations is completing without errors then you may want to just use something like curl to get things working before introducing load testing with bench-rest.

If only some of the iterations are erroring out then you may have a scalability issue which is showing up under load and causing things to timeout.

Certainly if your service pauses for too long between handling requests then it could cause timeouts.

jeffbski avatar Feb 17 '16 17:02 jeffbski

@andela-omesanni would you mind sharing the script that you are trying to run??

ffoysal avatar Oct 21 '16 02:10 ffoysal

I'm running this script:

var benchrest = require('bench-rest');

 var flow = {
    main: [
{ post: 'https://192.168.1.88:3000/interactions/updateOrSaveInteractionTree/#{INDEX}/',strictSSL: false, headers: { 'Accept': 'application/json'},json: 
{
"ani": " 0333110712341",
"call_Id": "#{INDEX}"
}}
  ]
};

module.exports = flow;

and getting the same error with following stacktrace:

Failed in main, err:  { Error: socket hang up
    at createHangUpError (_http_client.js:331:15)
    at TLSSocket.socketOnEnd (_http_client.js:423:23)
    at emitNone (events.js:111:20)
    at TLSSocket.emit (events.js:208:7)
    at endReadableNT (_stream_readable.js:1055:12)
    at _combinedTickCallback (internal/process/next_tick.js:138:11)
    at process._tickCallback (internal/process/next_tick.js:180:9) code: 'ECONNRESET' }

Same API is working fine with curl.

saqib-ahmed avatar Apr 26 '18 07:04 saqib-ahmed