I am working with laravel queue jobs with Redis and using supervisor to manage multiple workers.
I have more than one numprocs which working perfectly for some days and then the supervisor goes down even if the supervisor in active state.
Because in supervisor, when supervisord fails more than startretries
value set in configure file to start program/worker then the program/worker goes to FATAL STATE then it will not processing any jobs, So when all workers gone on this state the supervisor goes down.
Then we need to restart the Supervisor manually to start processing again.
But this is not a proper solution for this.
My question is why supervisor fail to start and what is the solution for that ?
Reference Supervisor Doc:-http://supervisord.org/subprocess.html
My config file like this:-
[program:name]
process_name=%(program_name)s_%(process_num)02d
command=php /path/artisan queue:work --queue=queue1,queue2,queue3,queue4,default --tries=1 --daemon
autostart=true
autorestart=true
startretries=15
numprocs=150
user=root
redirect_stderr=true
stdout_logfile=/path/worker.log
stderr_logfile=/path/workerError.log
Update
My log file look like this
My stdout log file looks like this
Any help will be greatly appreciated.
The relevant log entries are:
exited: laravelw_106 (exit status 0; not expected)
gave up: laravelw_106 entered FATAL state, ntoo many start retries too quickly
The laravel queue worker stops immediately for some reason after being started. The queue worker is supposed to be long-running.
You need to find out why it exits; maybe you have an exit()
or die()
statement somewhere in your jobs.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With