Skip to content

chaitanyak59/Node-cluster

Repository files navigation

Basic Express App with Cluster Mode

This is a basic express application, which is created to test the performance when cluster mode is enabled.
Project has been written in typescript and uses autocannon for load test

Getting Started

Note: During Load test , your system might slow down, since it uses OS functionalities and this test utilizes a good amount of Ram and CPU.

I have configured load test for 5000 concurrent + pipelined requests.You can change the values in package.json if required

Prerequisites

  1. Pull Project in your local
  2. Goto Project Directory and do npm install
a.Development Mode

Usage

cmd: npm start (Project will run in port 6000)
Autocannon: After triggering the server, run npm run cannon

b.Production Mode

Usage

important: stop Dev server if running
cmd: npm pm2-start (Project will run in Cluster Mode, based on available cores)
Autocannon: After triggering the server, run npm run cannon

Built With

Authors

License

This project is licensed under the MIT License - see the LICENSE.md file for details