【发布时间】:2013-09-05 08:58:47
【问题描述】:
我有以下问题:
我想以齿轮工的身份运行一个 php 脚本,或者准确地说是 5 个工人。这是我的supervisord.conf-addition:
[program:gearman-test-worker]
process_name=%(program_name)s_%(process_num)02d
command=/usr/bin/php /path/to/gearman-jobs/worker.php
numprocs=5
directory=/path/to/gearman-jobs/
stdout_logfile=/var/log/gearman-job-server/supervisord.log
environment=GEARMAN_USER=gearman
autostart=true
autorestart=true
user=gearman
stopsignal=KILL
当我启动它supervisord -n(或在守护程序模式下)它只会产生 1 个实例而不是 5 个。消息看起来很好
[root@pc113 gearman-jobs]# supervisord -n
2013-09-03 14:24:58,775 CRIT Supervisor running as root (no user in config file)
2013-09-03 14:24:58,789 INFO /var/tmp/supervisor.sock:Medusa (V1.1.1.1) started at Tue Sep 3 14:24:58 2013
Hostname: <unix domain socket>
Port:/var/tmp/supervisor.sock
2013-09-03 14:24:58,850 CRIT Running without any HTTP authentication checking
2013-09-03 14:24:58,850 INFO supervisord started with pid 8722
2013-09-03 14:24:58,853 INFO spawned: 'gearman-test-worker' with pid 8723
2013-09-03 14:24:59,858 INFO success: gearman-test-worker entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
并且没有提示为什么它只产生一个实例。你能帮忙吗?
【问题讨论】:
-
顺便说一下,创建 5 个程序小节并删除 numprocs 参数会导致工人正确生成。
标签: php supervisord gearman