PM2

PM2 Cluster Mode

Cluster Mode The cluster mode allows networked Node.js applications (http(s)/tcp/udp server) to be scaled accross all CPUs available, without any code modifications. This greatly increases the performance and reliability of your applications, depending on the number of CPUs available. Under the hood, this uses the Node.js cluster module such that the scaled application’s child processes can automatically share server ports. To learn more, see How It Works in the official Node.js documentation on the cluster module. Usage To enable the cluster mode, just pass the -i option: pm2 start app.js -i...

Read more...

PM2 Process Management

Managing applications states PM2 is a process manager. It manages your applications states, so you can start, stop, restart and delete processes. Start a process: pm2 start app.js --name "my-api" pm2 start web.js --name "web-interface" Now let’s say you need to stop the web-interface: pm2 stop web-interface As you can see the process hasn’t disappeared. It’s still there but in stopped status. To restart it just do: pm2 restart web-interface NB: starting PM2 2.1.x, restarts are immutable, meaning that environment changes will not change your process, see –update-env Now you want to delete the app from the PM2...

Read more...

PM2 Server Installation, Start Service, Stop, Delete, restart, update

Welcome! Welcome to the PM2 Quick Start! PM2 is daemon process manager that will help you manage and keep your application online. Getting started with PM2 is straightforward, it is offered as a simple and intuitive CLI, installable via NPM. Installation The latest PM2 version is installable with NPM or Yarn: $ npm install pm2@latest -g # or $ yarn global add pm2 To install Node.js and NPM you can use NVM Start an app The simplest way to start, daemonize and monitor your application is by using this command...

Read more...