I use supervisor to start either php-cgi processes and proxy from nginx, the
number of workers is adjusted by the numprocs param, example:

[program:php]
command=/usr/bin/php-cgi -b 127.0.0.1:15000 -c /etc/php5/cgi/php.ini


numprocs=6

Starts 6 php processes.

Your gearman worker needs to keep itself up and running until it gets
"QUIT"ed to make this work, php-cgi does that.

Some other programs do the worker handling internally, like gunicorn (python
wsgiserver), example:

[program:gunicorn]
command=/path/to/virtualenv/bin/gunicorn_django --bind 127.0.0.1:15001
 --workers=4
directory=/var/www/trip/team.nwebs.de/env
stopsignal=QUIT

Hope that helped
Daniel

2011/4/11 Beyrent, Erich C <[email protected]>

>  I am new to supervisor, and am trying to create a configuration that will
> launch 6 gearman workers and keep them up and running.  With the
> configuration I have posted, only one worker gets created, but I’m not sure
> why.  What am I doing wrong?
>
>
>
> [program:my_worker]
>
> command=/usr/local/bin/php /site/lib/gearman_workers/my_worker.php
>
> directory=/site/lib/gearman_workers
>
> process_name=%(process_num)s
>
> numprocs=2
>
> autostart=true
>
> autorestart=true
>
> startsecs=10
>
> startretries=3
>
> exitcodes=0,2
>
> stopsignal=QUIT
>
> stopwaitsecs=600
>
> user=www
>
> log_stdout=true
>
> log_stderr=true
>
> logfile=/var/log/workers.log
>
>
>
>
>
> -Erich-
>
> _______________________________________________
> Supervisor-users mailing list
> [email protected]
> http://lists.supervisord.org/mailman/listinfo/supervisor-users
>
>
_______________________________________________
Supervisor-users mailing list
[email protected]
http://lists.supervisord.org/mailman/listinfo/supervisor-users

Reply via email to