Best practices for running multiple instances of the same program with runit (rqworker)

30 views
Skip to first unread message

matti...@softagram.com

unread,
Apr 11, 2019, 4:38:19 AM4/11/19
to passenger-docker
I need to run multiple instances of rqworker processes in our container. There's an environment variable that is used to set the number of concurrent processes. To my understanding, runit does not support launching & controlling multiple instances of the same executable. I can see here a couple alternatives, would like to hear your proposals and opinions on them:

1. supervisord is designed to control any number of concurrent processes for a single executable, and it is not designed to replace the PID 1 process, but instead to run as just another daemon among others. Install supervisord to the container, launch it as one of the runit services and let it control the rqworkers.
2. Specify e.g. 8 static rqworker services for runit in Dockerfile. Then in a container startup script, disable the unnecessary ones/enable only those needed. Not sure if this is meaningfully doable and it'll kind of add useless bloat to the docker image. As well as limit us to certain maximum number of workers.

I'm now inclined to go with the supervisord setup as it seems to provide better flexibility. But wanted to see if there are any runit-only alternatives that people have used in similar cases. Would be nice to avoid any useless complexity with the process handling.
Reply all
Reply to author
Forward
0 new messages