Skip to content
gohacks.dev
Standard Library

Supervisor Config Generator

Generate a Supervisor program for Laravel queue workers or any long-running command, with process count, user, logs and a safe stop timeout.

Free · No sign-up · Your inputs stay in your browser

Input

Generate a Supervisor program

Output

/etc/supervisor/conf.d/laravel-worker.conf

417 characters

Load it with sudo supervisorctl reread && sudo supervisorctl update, then sudo supervisorctl start 'laravel-worker:*'. This is the shape the Laravel queue documentation uses; after each deploy run php artisan queue:restart so workers finish their job and reload the code.

Runs in this browser. Nothing you paste is sent to a server.

Why a worker needs supervising

php artisan queue:work is a long-running process that exits on fatal errors, when it hits --max-time or --max-jobs, and on queue:restart. Something has to start it again, and the Laravel queue docs use Supervisor for that. systemd works just as well.

Stop timeouts

On a deploy or a stop, Supervisor sends SIGTERM and waits stopwaitsecs before SIGKILL. Laravel's worker finishes its current job on SIGTERM, so the wait must be longer than your longest job, or the job is killed half done and retried.

Share

Frequently asked questions

How many worker processes should I run?
Start with one or two per CPU core for I/O-bound jobs and watch queue latency. CPU-heavy jobs gain nothing from more processes than cores.
Why are my workers running old code after a deploy?
A worker loads the application once and keeps it in memory. Run php artisan queue:restart after each deploy; Supervisor restarts them with the new code.
Is what I paste sent anywhere?
No. The tool runs entirely in your browser with JavaScript. Nothing you type or paste is sent to our server or stored.

Keep planning

Similar tools