4 ms·
What do you recommend instead?
by arnaudsm 5y ago
What do you recommend instead?
- nodesocket 5y agoJust invoke your script: CMD ["/usr/local/bin/node", "server.js"]
- TameAntelope 5y agopm2 is good for some things.
- nodesocket 5y agopm2 is great when running on servers, but using pm2 in containers feels wrong and again wasteful. Just invoke your script. If it crashes, fine Kubernetes or Docker handles that. Logs, handled by k8s. Monitoring I use DataDog.
- chousuke 5y agoWhat's the point of pm2? Every time I've seen it it's just been part of a messy misconfigured system and whatever it's actually doing could've been accomplished entirely with a tiny systemd unit running node directly.
- TameAntelope 5y agoFrom their site, I’m on mobile so the paste is a little rough. BEHAVIOR CONFIGURATION SOURCE MAP SUPPORT CONTAINER INTEGRATION WATCH & RELOAD LOG MANAGEMENT MONITORING MODULE SYSTEM MAX MEMORY RELOAD CLUSTER MODE HOT RELOAD DEVELOPMENT WORKFLOW STARTUP SCRIPTS DEPLOYMENT WORKFLOW PAAS COMPATIBLE KEYMETRICS MONITORING API
- speedgoose 5y agoYou shouldn’t use pm2 in software containers. That makes things more complex and not standard.
- jwdunne 5y agoCan echo this. A colleague’s node container was maxing out CPU and just removing PM2 and running node directly solved the problem. That was easier than debugging why PM2 was having such a hard time. To be fair, it was a straight up conversion of an old VM in vagrant and Docker was looked at as a one to one replacement before learning otherwise.
- TameAntelope 5y agoIt gives you a bunch of stuff you don’t get running the script directly, and costs nothing, so why wouldn’t I opt for that? They even have an explicit, “run in container” mode.