Supervisorctl does not auto-restart daemon queue worker when hanging

旧时模样 提交于 2019-12-08 07:33:27

问题


I have supervisorctl managing some daemon queue workers with this configuration :

[program:jobdownloader]
process_name=%(program_name)s_%(process_num)03d
command=php /var/www/microservices/ppsatoms/artisan queue:work ppsjobdownloader --daemon --sleep=0
autostart=true
autorestart=true
user=root
numprocs=50
redirect_stderr=true
stdout_logfile=/mnt/@@sync/jobdownloader.log

Sometimes some workers are like hanging (running but stop getting queue messages) and supervisorctl does not automatically restart them, so I have to monitor and manually restart them.

Is there something wrong with the configuration? What can I do to prevent this to happen in the future?


回答1:


Update :

Run the process as normal process (non-daemon) so that supervisorctl can restart the workers after they signal exit code :

[program:jobdownloader]
process_name=%(program_name)s_%(process_num)03d
command=php /var/www/microservices/ppsatoms/artisan queue:work ppsjobdownloader --sleep=0
autostart=true
autorestart=true
user=root
numprocs=50
redirect_stderr=true
stdout_logfile=/mnt/@@sync/jobdownloader.log


来源:https://stackoverflow.com/questions/32759609/supervisorctl-does-not-auto-restart-daemon-queue-worker-when-hanging

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!