Replace supervisor with systemd unit #1570
Comments
In reality, there is nothing to replace because supervisor is just a suggestion; i.e. there's no real technical dependency on it. Of course I see that the docs talk only about it, as this is just the way the docs were written. I suggest you rather make a nice documentation PR how one can use IMO this is a complex topic, it would be nice if it would cover everything the current guide for supervisor covers (i.e. stdout/stderr log redirection, max restart tries, etc.) |
How do you run multiple queue workers that way? |
This one works for me well but it's not indeed to Ctrl+C and Ctrl+V into projects. |
Agree with @mfn this is a DOC pr rather than an idea for Laravel |
Using systemd for multiple workers quickly becomes weird. You cannot list them in the queue parameter as suggested, this just adds more queues to the responsibility of a single worker process. I don't think that a systemd unit with type=simple supports several ExecStart. A quick look around makes me think we need some a parent unit and several child units, where the child units uses Supervisor's |
Supervisor conf from https://symfony.com/doc/current/messenger.html#supervisor-configuration ``` ;/etc/supervisor/conf.d/messenger-worker.conf [program:messenger-consume] command=php /path/to/your/app/bin/console messenger:consume async --time-limit=3600 user=ubuntu numprocs=2 autostart=true autorestart=true process_name=%(program_name)s_%(process_num)02d ``` systemd conf from: laravel/ideas#1570 PD: Systemd is not 'do one thing and do it well' is a feature creep
Could this help? https://unix.stackexchange.com/a/288310
Still, Supervisor's numprocs=3 looks better - but systemd is already there. |
If you're using Laravel with AWS Elasticbeanstalk, AWS EB doesn't provide supervisor out of the box and I ended up integrating systemd. |
As almost linux distros have been shipped with powerful
systemd
daemon it's not neccessary to install supervisord it to run queusA simple unit like that does all the job
you have to place it in
/etc/systemd/system
systemctl daemon-reload
systemctl enable laravel-queue.service
systemctl start laravel-queue.service
The text was updated successfully, but these errors were encountered: