Skip to content

Instantly share code, notes, and snippets.

@mgrimard
Created February 26, 2016 19:33
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mgrimard/5087f24c01973acacf32 to your computer and use it in GitHub Desktop.
Save mgrimard/5087f24c01973acacf32 to your computer and use it in GitHub Desktop.
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:*
    
@MrFiregore
Copy link

just what I need, thx 😄

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