Hi, all.  I am using runit to supervise a large set of nearly identical
processes.  Each process accesses certain IO-bound shared resources
(e.g. NFS mount) at startup.  At system initialization, when runsvdir is
launched, it launches all these processes (via runsv) essentially
simultaneously.  This causes a big resource contention at initialization
that occasionally causes problems.

What I would like is to somehow stagger the startup of the processes, to
avoid the resource contention.  I could do this by putting a random
sleep into the ./run scripts, but this would also cause random startup
delays on subsequent process restarts via "sv restart" or the like
(which we occasionally need to do).

What I would prefer instead is to add random delays to the startup of
the *runsv* processes, since this would only apply at system
initialization.  Unfortunately I can't see any way to do that right now
(other than somehow wrapping the runsv binary itself).

Does anyone know any way to accomplish what I'm looking for?  I don't
believe runsvdir supports any options that would apply here.  Is it
possible to somehow point runsvdir to a alternate runsv executable to
which I could add the random delays?

Any suggestions would be much appreciated.  Thanks.

jamie.

Attachment: signature.asc
Description: PGP signature

Reply via email to