Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/yarax/nnb
Native Node.js module for stress testing
https://github.com/yarax/nnb
Last synced: about 1 month ago
JSON representation
Native Node.js module for stress testing
- Host: GitHub
- URL: https://github.com/yarax/nnb
- Owner: yarax
- Created: 2015-08-29T23:30:03.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2016-06-25T18:27:23.000Z (over 8 years ago)
- Last Synced: 2024-08-05T10:15:31.884Z (5 months ago)
- Language: C++
- Homepage:
- Size: 34.2 KB
- Stars: 16
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Native Node.js Benchmark module for stress testing
As you know Node.js has only one thread that doesn't allow to reach high performance in stress HTTP requesting.
Nnb uses C++ Posix threads to reach high concurency.
The limit for concurrency is on your system, check it `ulimit -n`### Usage
```
var Nnb = require('nnb');
var nnb = new Nnb({
host: 'google.com',
path: '/',
port: 80,
method: 'GET',
concurrency: 50,
headers: {
'user-agent': 'Mozilla/5.0'
},
headersOnly: true
});
nnb.go(function (err, result) {
console.log(result);
});
```Output:
```
[ { time: 80,
body: '',
headers: 'HTTP/1.1 200 OK\r\nDate: Mon, 28 Dec 2015 10:37:35 GMT\r\nConnection: close\r\n\r\n' },
....
]
````headersOnly` flag is used to avoid getting bytes further from socket right after getting all headers.
In most cases that's enough to understand servers respond time and correctness.Result is array of strings, given by server for each request