2

I am running queue for my laravel app using systemd. Here's my service file

[Unit]
Description=Mosharaf isdp queue

[Service]
User=nginx
Group=nginx
Type=simple
Restart=always
Nice=10
WorkingDirectory=/var/www/html/mosharaf_isdp/
ExecStart=/usr/bin/php artisan queue:work  --sleep=10 --timeout=1800 --tries=1
TimeoutStartSec=30
[Install]
RequiredBy=multi-user.target

Using this service file all of my jobs are being processed one by one. I have followed steps given in here and here. Both of them says

To run multiple workers you have to list them in "queue" parameter

by this i am guessing they mean to add it in below line like that.

ExecStart=/usr/bin/php artisan queue:work --queue=default --sleep=10 --timeout=1800 --tries=1

But my question is isn't it specifying which queue to run ?

All of my jobs are stored as default and i want multiple workers to process them.

How can i do that ?

N.b., While i was using supervisor there was a key in it's config file as numprocs which specified number of workers. Is there something like this here or i have to put my jobs in different queue say q1,q2,q3 and add them like below to activate 3 workers ?

ExecStart=/usr/bin/php artisan queue:work --queue=q1,q2,q3 --sleep=10 --timeout=1800 --tries=1
mosharaf
  • 121
  • 2
  • 1
    Does this answer your question? [Start N processes with one systemd service file](https://serverfault.com/questions/730239/start-n-processes-with-one-systemd-service-file) In particular see [this answer](https://serverfault.com/a/878398/126632). – Michael Hampton Feb 11 '21 at 13:15
  • Got it. Thanks :D – mosharaf Feb 11 '21 at 13:37

0 Answers0