28

I want to write one web application with node.js and MongoDB and I have got task to even test it. I would like to know if there are any tools like JMeter or anything else for load/stress testing of Node.js?

EDIT

My application is going to be information extraction kind of application and client expects extraction should not take more than 10 seconds for one document. Currently I have same application written in C# but its not scaling upto client's expectations. Then I came across this beautiful and fast Node.js. I think Node.js can help me alot.

Please enlighten !!!

Shekhar
  • 11,438
  • 36
  • 130
  • 186
  • 2
    Proper load testing depends on what your application does. There will be no generic tool that can test all Node.js applications. Keep in mind that Node.js applications don't even have to provide a web interface! The best thing you could do would be to write your own application that simulates usage of your Node application. – Brad Aug 31 '12 at 19:00
  • My application is going to be information extraction kind of application. – Shekhar Aug 31 '12 at 19:01

3 Answers3

20

Try nodeload: it's a collection of node.js modules for load testing HTTP services.

As a developer, you should be able to write load tests and get informative reports without having to learn another framework. You should be able to build by example and selectively use the parts of a tool that fit your task. Being a library means that you can use as much or as little of nodeload as makes sense, and you can create load tests with the power of a full programming language. For example, if you need to execute some function at a given rate, just use the 'nodeload/loop' module, and write the rest yourself

Just found out that this package is no longer under development so here are some active forks:

laktak
  • 57,064
  • 17
  • 134
  • 164
12

Why couldn't you test a node server with JMeter? For most load tests it doesn't matter what language your server is, you're just hitting it with a bunch of requests.

In any case, you could try loadtest which is implement in node.

Runs a load test on the selected HTTP or WebSockets URL. The API allows for easy integration in your own tests.

Edit:

This answer provides more options:

NodeJs stress testing tools/methods [closed]

Community
  • 1
  • 1
anthonygore
  • 4,722
  • 4
  • 31
  • 30
5

Try artillery. Here are its features, the description of which is taken from the documentation:

  • Multiple protocols: Load test HTTP, WebSocket, Socket.io, Kinesis, HLS and more.
  • Scenarios: Support for complex scenarios to test multi-step interactions in your API or web app (great for ecommerce, transactional APIs, game servers etc).
  • Load testing & Functional testing: reuse the same scenario definitions to run performance tests or functional tests on your API or backend.
  • Performance metrics: get detailed performance metrics (latency, requests per second, concurrency, throughput).
  • Scriptable: write custom logic in JS, using any of the thousands of useful npm modules.
  • Integrations: statsd support out of the box for real-time reporting (integrate with Datadog, Librato, InfluxDB etc).
  • Extensible: write custom reporters, custom plugins, custom protocol engines etc.
  • and more! HTML reports, nice CLI, parameterization with CSV files.
ns16
  • 1,322
  • 2
  • 17
  • 26