How to do load testing of node.js server?
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:
- https://github.com/gamechanger/nodeload
- https://github.com/Samuel29/NodeStressSuite
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]
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.