Skip to content

Instantly share code, notes, and snippets.

@arif98741
Created December 11, 2023 07:51
Show Gist options
  • Save arif98741/69f617874744aaf57c53a19e5d8a59c3 to your computer and use it in GitHub Desktop.
Save arif98741/69f617874744aaf57c53a19e5d8a59c3 to your computer and use it in GitHub Desktop.
Install Supervisor for Running Laravel Background Job
sudo apt-get install supervisor
sudo systemctl stop supervisor
sudo systemctl start supervisor
sudo systemctl status supervisor
sudo nano /etc/supervisor/conf.d/laravel-queue-project1.conf
[program:laravel-queue-project1]
process_name=%(program_name)s_%(process_num)02d
command=php /var/www/project1/artisan queue:work --queue=default --sleep=3 --tries=3 --max-time=3600
autostart=true
autorestart=true
stopasgroup=true
killasgroup=true
user=www-data
numprocs=8
redirect_stderr=true
stdout_logfile=/var/log/laravel-queue.log
sudo supervisorctl reread
sudo supervisorctl update
sudo supervisorctl start laravel-queue-project1:*
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment