New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

nnb

Package Overview
Dependencies
Maintainers
1
Versions
12
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

nnb

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`

  • 1.0.5
  • latest
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

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 MR({
            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

Keywords

FAQs

Package last updated on 30 Dec 2015

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc