jeffbski / bench-rest

bench-rest - benchmark REST (HTTP/HTTPS) API's. node.js client module for easy load testing / benchmarking REST API's using a simple structure/DSL can create REST flows with setup and teardown and returns (measured) metrics.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Socket hang up

omesanni opened this issue · 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?

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.

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

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.