Is it possible to spawn new program in supervisord via XML-RCP?
I’m using supervisord to manage my Apache Qpid broker and my python workers. I would like to be able to spawn more workers when the number of messages in the queue exceeds a certain limit.
So far I have only managed to start and stop already running processes. But I would like to specify a general program in the supervisord.conf and start them on the fly.
Example program:
[program:qpid_worker]
command=python path/to/worker.py
autorestart=true
process_name=worker
redirect_stderr=true
stdout_logfile=/tmp/worker.log
stdout_logfile_maxbytes=50MB
stdout_logfile_backups=10
loglevel=warn
Anyone knows if this is possible?
No, that is not a feature supported by supervisord. It has no facility to create an arbitrary number of processes based on a template.
You’ll have to pre-define your workers and start and stop those as needed.