- Follow Supervisord’s installation instructions.
- Place the
laravel_queue.conffile in your/etc/supervisord.confdirectory - Run
$BINDIR/supervisordto boot up supervisord. You may need to have root privileges. - Run
$BINDIR/supervisorctlto open the supervisord shell console. You may need to have root privileges. - Add the queue workers by running
add queuein the supervisord shell.
program: The name of your program. If you modify this, you will need to runadd $NEW_PROGRAM_NAMEinstead ofadd queuein the supervisorctl shell in the setup step.command: You can use any queue options supported by Laravel here. Commone ones aretriesto retry failed jobs before aborting andtimeoutto 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.logredirect_stderr: atruevalue 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 setnumprocsto a value greater than 1, you will need to give each worker instance a unique process name. The default%(program_name)s_%(process_num)02dvalue will assign unique names automatically
- If you make modifications to a configuration file, run
reread $PROGRAM_NAMEin the supervisorctl shell to pull in the changes.