PM2 is an advanced Node.js process manager that make easy to manage all your Node.js applications such as “start|stop|reload|delete”.
Some of pm2’s features are:
Source map support
Watch & Reload
…and much more
For installation we will use npm such as:
npm install pm2 -g
This will install pm2 globally!
To set pm2 for starting a new app is enough to:
pm2 start index.js --name "My app" -i max
# => index.js is app's index script
# => --name "My app" is the name of the app that will appear on pm2 monitor
# => -i max sets the CPUs number to use:
max - use all CPUs
-1 - use all CPUs
<number> - use only <number> of CPUs
To start a Node.js app in production environment you must set it in ~/.profile file such as:
Who is Florin Lungu? Florin Lungu is a boy of 29 years of Romanian origin. He was arrived in Italy in 2006. From 2007 until 2011 he attended the ITIS A.Righi of Naples following with great interest in computer science courses. He is a member of a non-profit association NALUG that he follow about many years and actively participate in the meetings and events organized by the association. In his spare time he is devoted to the development of his web projects as well as following various open-source projects on GitHub as well as those on Launchpad.