Performance: PM2 for process management
PM2 affects server-side process management impacting backend response time and uptime, indirectly influencing frontend load speed and user experience.
pm2 start app.js --watch
node app.js
| Pattern | CPU Usage | Memory Usage | Downtime Risk | Verdict |
|---|---|---|---|---|
| No process manager (node app.js) | Low initially | Low initially | High (crashes cause downtime) | [X] Bad |
| PM2 with process monitoring | Slightly higher (~5% overhead) | Slightly higher | Very low (auto-restart) | [OK] Good |
PM2 in Node.js application management?app.js using PM2?pm2 start <file>.pm2 start app.js --name myapp pm2 restart myapp pm2 stop myapp pm2 delete myapp
myapp after these commands?pm2 start app.js --name myapp starts and names the app. pm2 restart myapp restarts it. pm2 stop myapp stops it but keeps it listed. pm2 delete myapp removes it from PM2's list.pm2 start app.js but the app crashes immediately. Which PM2 command helps you see the error logs to debug the issue?pm2 logs shows real-time logs including errors from apps managed by PM2.pm2 status and pm2 list show process info but not detailed logs. pm2 restart restarts apps but doesn't show logs.server.js whenever the file changes during development. Which command achieves this?--watch flag tells PM2 to watch for file changes and restart the app automatically.--no-restart disables restarts, --ignore-watch disables watching, and --restart-delay adds delay but doesn't enable watching.Pass the test and this pattern moves unknown