Skip to content

Instantly share code, notes, and snippets.

@abenevaut
Last active June 21, 2024 11:18
Show Gist options
  • Save abenevaut/877b2624b8334c15d4722f3b4724cc7a to your computer and use it in GitHub Desktop.
Save abenevaut/877b2624b8334c15d4722f3b4724cc7a to your computer and use it in GitHub Desktop.
brew install supervisor
cd /opt/homebrew/etc
emacs supervisord.conf
cd /opt/homebrew/etc/supervisor.d
emacs <NAME>-worker.ini;

WARNING: When text editors leave cache files during modifications, supervisor can pick them up and run undesirable services.

supervisorctl stop all
supervisorctl restart all
supervisorctl status
[program:<NAME>-worker]
process_name=%(program_name)s_%(process_num)02d
command=/opt/homebrew/bin/php /Users/<USERNAME>/Sites/<PROJECT>/artisan queue:work <DRIVER> --sleep=3 --tries=3 --max-time=3600 --queue=high,default,low
autostart=true
autorestart=true
stopasgroup=true
killasgroup=true
user=<USERNAME>
numprocs=8
redirect_stderr=true
stdout_logfile=/Users/<USERNAME>/Sites/<PROJECT>/storage/logs/worker.log
stopwaitsecs=3600
[unix_http_server]
file=/opt/homebrew/var/run/supervisor.sock ; the path to the socket file
[supervisord]
logfile=/opt/homebrew/var/log/supervisord.log ; main log file; default $CWD/supervisord.log
logfile_maxbytes=50MB ; max main logfile bytes b4 rotation; default 50MB
logfile_backups=10 ; # of main logfile backups; 0 means none, default 10
loglevel=info ; log level; default info; others: debug,warn,trace
pidfile=/opt/homebrew/var/run/supervisord.pid ; supervisord pidfile; default supervisord.pid
nodaemon=false ; start in foreground if true; default false
silent=false ; no logs to stdout if true; default false
minfds=1024 ; min. avail startup file descriptors; default 1024
minprocs=200 ; min. avail process descriptors;default 200
[rpcinterface:supervisor]
supervisor.rpcinterface_factory = supervisor.rpcinterface:make_main_rpcinterface
[supervisorctl]
serverurl=unix:///opt/homebrew/var/run/supervisor.sock ; use a unix:// URL for a unix socket
[include]
files = /opt/homebrew/etc/supervisor.d/*.ini
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment