pm2, systemd or supervisord

pm2, a systemd Unit or supervisord: Choosing One

supervisord 121,801 (github.com/Supervisor/supervisor (https://github.com/Supervisor/supervisor 9,122 ), BSD-style licence) is a Python daemon driven by INI files; 4.3.0 is both the newest release and Ubuntu 26.04 225 's package. Laravel 2,157 's queue documentation uses it.

/etc/supervisor/conf.d/ch01-08-worker.conf: the same worker, two copiesShell
[program:ch01-08-worker]
command=/usr/bin/php /tmp/ch01-08/worker.php
user=dev
numprocs=2
process_name=%(program_name)s_%(process_num)02d
autorestart=true
stdout_logfile=/var/log/supervisor/%(program_name)s_%(process_num)02d.log
redirect_stderr=true
Loading the program and checking itShell
sudo supervisorctl update
sleep 2; sudo supervisorctl status
Output
ch01-08-worker: added process group
ch01-08-worker:ch01-08-worker_00   RUNNING   pid 15521, uptime 0:00:03
ch01-08-worker:ch01-08-worker_01   RUNNING   pid 15522, uptime 0:00:03

After a kill -9 on worker 00, supervisord logged terminated by SIGKILL; not expected and respawned it a second later. All three restart crashes; the memory below is each manager's own resident size here.

Three ways to keep a program alive
systemd 142,543 unit pm2 29,762 supervisord
Extra daemon None (PID 1) Node.js 2,131 , 76 MiB Python, 27 MiB
Boot start systemctl enable startup + save Its own unit
Root needed To install a unit Only for startup To edit config
Limits, logs cgroups, journald Memory cap, files None, files
Several copies worker@.service -i N numprocs

On a LAMP server a systemd unit (Your Own Unit File) is the default: nothing extra to patch, real limits, sandboxing (Overrides and Sandboxing) and one journal. Choose supervisord for Laravel's conventions or many workers in one group, and pm2 if you already run Node.js, want cluster mode, or deploy as a user who may restart apps but not edit /etc. systemd starts both, so they add a layer. Laravel applies this to queue workers.