I’m thinking of switching from Node.js to another programming language (Elixir). And in Node, I’ve used PM2 as a process manager. Now, the thing is, I don’t want to use PM2 for process management, since I would need Node as a dependency and PM2 is more for Node.js application processes (although I know that you can run non-Node applications with it).
So, my question is: what can I use as a PM2 replacement for non-Node.js applications?
Features that I need from this tool:
- listing processes and getting their stats (CPU, memory etc.)
- tasks for starting/restarting/deleting processes
- auto-restart process on crash
- logs displaying and storing
- (optional) some monitoring tools (something like Prometheus)
- (optional) auto-restart process on files change
Virtually any service, including those you used to run with pm2, can be run from a systemd unit. And this is better integrated into the Linux distribution anyway. Most languages/web app frameworks will provide a sample systemd unit you can use.
For instance, if you are programming in Elixir, you are likely using the Phoenix Framework, for which you can find sample systemd units and assistance on the Elixir forum.
This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License.