Subject: Re: [vserver] start-vservers patch
From: Jeff Jansen <jeff.jansen@kkoncepts.net>
Date: Tue, 01 Feb 2011 15:48:20 +0800

On Tuesday 01,February,2011 02:03 PM, Daniel Hokka Zakrisson wrote:
> Why aren't you just using the depends file to specify dependencies?

As I understand it, using the 'depends' files either mean you start all
your vservers one at a time, or you start them in groups of X number at
a time, but you can't control the order within that group.  Worse, you
may wait until a whole group of X is finished before starting the next
group.

Let's say I've got 26 vservers, 'A'-'Z' and I want them to start in the
order 'Z'-'A'.  So I make 'Y' depend on 'Z', 'X' depend on 'Y', etc.
But in that case, they start one at a time each one waiting until the
next is started.  Starting 26 vservers one at a time takes WAY too long.

Now imagine that I've told it to start 6 at a time.  So I make 'O'-'P'
depend on 'U'-'Z', 'I'-'N' depend on 'O'-'P', etc.  But now the WHOLE
group of 6 needs to start before the next group will start.  So I'm at
the mercy of the slowest starting vserver in each group.

So I make 'O'-'P' depend only on 'U', or 'Z', or whichever one I want.
But the scripts still wait until that vserver  starts before it starts
any more.  So there is still waiting time unless I always specify the
fastest vserver as the dependency.

But even in that case, each group of 6 still starts alphabetically
within the group.  'O' then 'P' then 'Q', etc. There's no way to make
'S' first in this group of 6 unless I set that 'O' and 'P' and 'Q' and
'R' depend on 'S', which means I'm back to waiting while a single
vserver starts before the others start.

And if I want to start more or less at a time, I have to redo all the
depends files, because I set them up assuming 6 to start at the same time.

With the 'startorder' file, the vservers are started in the order I
specify and there's no waiting.  If I'm starting 6 at a time, then
numbers 1-6 start and as soon as any of them finished (doesn't matter
which one), number 7 starts, then 8, etc.  There's always 6 vservers
starting and they start in the order I specify.

If I change to starting 8 a time, then 1-8 start and 9 starts as soon as
any of those 8 finish, and so on.

If I've totally missed how to use the 'depends' file, then I'd love to
hear how I can use it to accomplish my goals - start/stop my vservers in
a particular order and always keep X number starting/stopping at the
same time.  But this patch does that for us.  And the only affect it has
if you don't use the 'startorder' files is that vservers stop in reverse
alphabetical order (assuming no 'depends' files).  That could be easily
changed if it's a problem.

Jeff Jansen