Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
How to set up Laravel Queue Daemons

Laravel - Setting Up Queue Daemons

  1. Install Supervisor if not already:

     sudo apt-get install supervisor
    
  2. Create Worker File:

     touch /etc/supervisor/conf.d/laravel-worker.conf
    
  3. Fill the worker file with the following information:

     [program:laravel-worker]
     process_name=%(program_name)s_%(process_num)02d
     command=php /PATH/TO/WEBAPP/artisan queue:work --sleep=3 --tries=3 --daemon
     autostart=true
     autorestart=true
     user=username
     numprocs=8
     redirect_stderr=true
     stdout_logfile=/PATH/TO/WEBAPP/storage/logs/worker.log
    
  4. Run the following commands to initialize and start worker:

     sudo supervisorctl reread
     sudo supervisorctl update
     sudo supervisorctl start laravel-worker:*
    
@firegore2

This comment has been minimized.

Copy link

@firegore2 firegore2 commented Feb 18, 2021

just what I need, thx 😄

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment