0

I was doing testing of my nodeJS localhost server and I used artillery tool for testing the load on the server. So, here I just want to test the concurrency level of the server like how many requests can server handle concurrently. Please have a look at the below code & artillery config file.

My nodeJS code -

const express = require('express');

const app = express();

app.get('/', (req, res) => {
  // I've used the 5 second delay to make the proper async case
  setTimeout(() => res.send('Welcome node!!'), 10000); 
});

const server = app.listen(process.env.PORT || 3000, () => {
 const host = server.address().address
 const port = server.address().port
 console.log("Example app listening at http://localhost", host, port)
})

Artillery config file -

{
  "config": {
    "target": "http://localhost:3000",  
    "phases": [{
      "duration": 1,
      "arrivalRate": 10000
    }]  
  },
  "scenarios": [{
    "flow": [{
      "get" : {"url": "/"}
    }]
  }]
}

In short, Using artillery, I'm sending the 1000 requests/second.

But here I wonder, how Artillery gives the successful result and how can server able to handle the 10000 requests/second, despite every request takes 10 seconds to send the response (I've set the timeout of 10 seconds)

Artillery log -

enter image description here

Shubham
  • 1,163
  • 2
  • 12
  • 36

1 Answers1

1

The results in the screenshot you shared, above, look reasonable to me. You are attempting to send 10,000 requests over the 1-second duration of your test, while your client, server, network and perhaps other factors, in part or in sum, support ~526 requests per second (RPS), hence the ~19-second duration of your test. Your response times are all slightly greater than 10 seconds, as expected, given the timeout specified in your express server config and the relatively insignificant processing/payload involved. Were you hoping to see the entire test complete in just over 10 seconds (~10,000 RPS) or something similar?

Mark Drury
  • 11
  • 2
  • This does not provide an answer to the question. Once you have sufficient [reputation](https://stackoverflow.com/help/whats-reputation) you will be able to [comment on any post](https://stackoverflow.com/help/privileges/comment); instead, [provide answers that don't require clarification from the asker](https://meta.stackexchange.com/questions/214173/why-do-i-need-50-reputation-to-comment-what-can-i-do-instead). - [From Review](/review/low-quality-posts/20579518) – Robert Aug 14 '18 at 03:08
  • @Robert, the second and third sentences of my answer don't address the gist of the (somewhat vague) question? Perhaps you or the OP can clarify the intent, then? – Mark Drury Aug 14 '18 at 05:24