Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

zeshan77's avatar

Supervisor initiates more processes than expected

I've the following supervisor config file.

[program:laravel-worker]
process_name=%(program_name)s_%(process_num)02d
command=php /---/---/---/artisan queue:listen --tries=3
autostart=true
autorestart=true
user=ubuntu
numprocs=2
redirect_stderr=true
stdout_logfile=/---/---/---/worker.log

As per the file, it should create two process of queue:listen however when I run ps aux | grep php it shows 4 processes with two as queue:listen and two as queue:work as given below

ubuntu    2984  0.3  2.1 316504 44116 ?        S    11:10   0:04 php /---/---/---/artisan queue:listen --tries=3
ubuntu    2985  0.3  2.1 316504 44120 ?        S    11:10   0:04 php /---/---/---/artisan queue:listen --tries=3
ubuntu    8393 27.3  2.1 316640 44352 ?        S    11:32   0:00 php7.1 artisan queue:work --once --
ubuntu    8394 27.0  2.1 316640 44356 ?        S    11:32   0:00 php7.1 artisan queue:work --once --

Any help would be highly appreciated.

0 likes
1 reply
fideloper's avatar

That's normal behavior for queue:listen - it works by running a queue:work command (spawning a child process) that runs once (processes one job) before being killed and replaced with a new queue:work process.

Each queue:work process is a child process of a queue:listen process.

You can see this more clearly if you use the htop command and display using the tree view (via the f5 key)

Having the queue:listen command (re)start a new queue:work process for each job lets you update the code base without having to restart the workers (in theory).

1 like

Please or to participate in this conversation.