Performance: Queue worker supervision
MEDIUM IMPACT
This affects backend job processing speed and reliability, indirectly impacting frontend user experience by reducing delays and errors.
Use Laravel Horizon or Supervisor to monitor and auto-restart queue workers: # Supervisor config example [program:laravel-worker] command=php /path/to/artisan queue:work --sleep=3 --tries=3 process_name=%(program_name)s_%(process_num)02d numprocs=3 autostart=true autorestart=true stderr_logfile=/var/log/worker.err.log stdout_logfile=/var/log/worker.out.log
php artisan queue:work --once
# Manually restarting workers after failure or crash| Pattern | Worker Uptime | Job Processing Delay | Backend Throughput | Verdict |
|---|---|---|---|---|
| Manual restart after failure | Low (stops after one job) | High (delays until manual restart) | Low (jobs pile up) | [X] Bad |
| Supervisor or Horizon auto-restart | High (continuous running) | Low (immediate job processing) | High (parallel workers) | [OK] Good |