Giter Site home page Giter Site logo

node-concurrency's Introduction

Load Testing

$ heroku addons:create blazemeter
$ heroku addons:open blazemeter

Then set up a URL test to benchmark different classes of apps:

  • /cpu for CPU-bound apps
  • /io for IO-bound apps
  • /memory for memory-bound apps
  • / for a no-op route

This yields a hello-world type of baseline. The CPU-bound test does a little bit of computation, and then responds. The IO-bound test simulates waiting for a resource for 300ms, then responds. The memory-bound test generates a new 1 MB string for each response. The no-op route does essentially no work and generates the best performance you can expect with the given service and network configuration.

node-concurrency's People

Contributors

hunterloftis avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

node-concurrency's Issues

Followed the sample and getting Error about PORT in use

Continually getting this port conflict error:

Error: listen EADDRINUSE: address already in use :::55475

Using this basic code to start:


 const throng = require('throng')
 const WORKERS = process.env.WEB_CONCURRENCY || 5

...

function startProdApp() {
  var app = require('../app');
  let port = process.env.PORT;
  function onListen() {
    console.log('Listening on', port)
  }
  app.listen(port, onListen)
}

if(process.env.NODE_ENV === 'development'){
  startApp()
} else {
  throng({
       master: startProdApp(),
       worker: startProdApp(),
       count: WORKERS,
       lifetime: Infinity
   })
}

Heroku won't fork it appears - throng requires declaring the master and worker functions now https://github.com/hunterloftis/throng/blob/master/examples/complex.js

  if (typeof worker !== 'function') {
    throw new Error('Start function required');
  }

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.