- Follow Supervisord’s installation instructions.
- Place the
laravel_queue.conf
file in your/etc/supervisord.conf
directory - Run
$BINDIR/supervisord
to boot up supervisord. You may need to have root privileges. - Run
$BINDIR/supervisorctl
to open the supervisord shell console. You may need to have root privileges. - Add the queue workers by running
add queue
in the supervisord shell.
program
: The name of your program. If you modify this, you will need to runadd $NEW_PROGRAM_NAME
instead ofadd queue
in the supervisorctl shell in the setup step.command
: You can use any queue options supported by Laravel here. Commone ones aretries
to retry failed jobs before aborting andtimeout
to allow long-running jobs to finish before timing out.directory
: set this to the root directory of your Laravel projectstdout_logfile
: the path and filename where you want your log file to be stored. A reasonable place might be/$PATH_TO_YOUR_PROJECT/storage/logs/supervisor.log
redirect_stderr
: atrue
value specifies that you want the terminal output to be logged to the log file.numprocs
: the number of worker instances you wish to run. The more workers, the more concurrent jobs can be handled.process_name
: if you setnumprocs
to a value greater than 1, you will need to give each worker instance a unique process name. The default%(program_name)s_%(process_num)02d
value will assign unique names automatically
- If you make modifications to a configuration file, run
reread $PROGRAM_NAME
in the supervisorctl shell to pull in the changes.