Supervisor used to monitor process in Linux operating system, and helps to automatically restart our queue:work process if it fails.
Lets install Supervisor on Ubuntu, using the following command:
sudo apt-get install supervisor
Lets configure supervisor for a laravel project
We will find Supervisor configuration files stored in the /etc/supervisor/conf.d directory. In this directory, we may create any number of configuration files which will instruct supervisor how our processes should be monitored. For example, let’s create a myproject-worker.conf file that starts and monitors a queue:work process:
[program:myproject-worker]
process_name=%(program_name)s_%(process_num)02d
command=php /path/to/your/project/artisan queue:work --sleep=3 --tries=3 --daemon
user=sonnet
autostart=true
autorestart=true
numprocs=8
redirect_stderr=true
stdout_logfile=/path/to/your/project/storage/logs/supervisor.log

To start supervisor we have to execute bellow command in terminal
sudo supervisorctl reread
sudo supervisorctl update
sudo supervisorctl start your-worker-name:*