问题描述
我有supervisorctl使用此配置来管理某些守护程序队列工作器:
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
有时有些工作人员喜欢挂起(正在运行但停止获取队列消息),supervisorctl不会自动重新启动它们,因此我必须监视并手动重新启动它们.
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?
推荐答案
更新:
按正常进程(非守护程序)运行该进程,以便supervisorctl在发出退出代码后可以重新启动工作进程:
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
这篇关于挂起时,Supervisorctl不会自动重新启动守护程序队列工作器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!