Re: [Vserver] Shares and Reservations in the token-bucket-algorithm

From: Herbert Poetzl <herbert_at_13thfloor.at>
Date: Thu 27 Jul 2006 - 18:09:21 BST
Message-ID: <20060727170921.GA25742@MAIL.13thfloor.at>

On Thu, Jul 27, 2006 at 02:32:45PM +0200, Wilhelm Meier wrote:
> Am Donnerstag, 27. Juli 2006 13:20 schrieb Herbert Poetzl:
> > On Thu, Jul 27, 2006 at 09:50:37AM +0200, Wilhelm Meier wrote:
> > > Am Mittwoch, 26. Juli 2006 22:04 schrieb Herbert Poetzl:
> > > > > > well, not all solaris does is a good idea per se
> > > > > > and I think the current hard cpu scheduler is much
> > > > > > more powerful than the solaris proportional stuff
> > > > > > (i.e. you can consider the solaris settings a subset
> > > > > > of what you can achieve with the hard cpu scheduler)
> > > > >
> > > > > If the solaris fss is a subset, how do I set the token
> > > > > bucket values? With 3 vservers and 0.5 , 0.25 , 0.25 as
> > > > > (fillrate/intervall) for these, how do I get 2/3 for the first
> > > > > and 1/3 for the second vserver if the third vserver is idle as
> > > > > in the solaris fss case? Where is the hidden parameter?
> > > >
> > > > I take it that you 'simply' want fair scheduling
> > > > between three guests in a 2:1:1 ratio when all three
> > > > guests are hogging cpu, yes?
> > >
> > > Yes, the above settings of (fillrate/intervall) should achieve this.
> > >
> > > > in this case you simply forget the maximum values
> > > > i.e. set them to something very low to give some
> > > > kind of minimum amount of tokens per time unit, e.g.
> > > > 1/100 and use a set of 2:1:1 for the idle time values
> > > > e.g. 1/3,1/6 and 1/6. once hard cpu and indle time
> > > > is enabled for those guests, they will run in the
> > > > specified ratio, as long as host processes do not
> > > > consume cpu resources, in which case the remaining
> > > > cpu resources will be divided 2:1:1 between them
> > >
> > > But what happens if the third vserver falls to idle?
> > >
> > > In the solaris case the remaining two vservers would get 2/3 and
> > > 1/3 of the cpus (if the host ifself is idle as well).
> >
> > same here as there a 2/6 added for each idle time tick to
> > the first guest and 1/6 for the second one, which still
> > is 2:1 as in your 2/3 and 1/3 example ...
> >
> > > In the vserver case we get idle time now: 1/4 with the values above.
> >
> > how do you come to this conclusion?
>
> I try to summarize: we have three vservers with 1/2, 1/4, 1/4 as
> values for (fillrate/intervall)_1 (not idle time).
>
> If all three vservers have runnable processes, they get 1/2, 1/4, 1/4
> of a cpu (if we have more than one cpu we scale the values to sum up
> to the number of cpus).
>
> If the third vserver now gets idle, the first and second vserver still
> gets 1/2 and 1/4 of a cpu (if they have tokensmax in the bucket, they
> can get more of a cpu for a limited burst-time). In the long run there
> is 1/4 of a cpu idle.
>
> If we have setup the idle time bucket and the three vservers have
> the (fillrate/intervall)_2 values 1/2, 1/4, 1/4 for this also, the
> remaining 1/4 of the cpu (which is left idle from the normal tocken
> bucket) is given to the vservers.
>
> If the third vserver is still idle, the first vserver gets 1/4 * 1/2
> from the idle token bucket and this sums to 1/2 + 1/8 = 5/8. The
> second vserver sums up to 1/4 + 1/4*1/4 = 5/16.
>
> So the ratio between the first and second vserver is still 2:1. But
> we left 1/16 of a cpu idle. And this leds to a recursion and then the
> two active vservers gets 2/3 and 1/3 of a cpu. Yes, I think I got it
> ;-)

> Thank you!

you're welcome!

> Is this type of scheduler already in the stable version?

it is in the _very stable_ development branch :)

HTH,
Herbert

> ...
> >
> > as usual, all the features are supported by my 'hack' tools
> > in various forms, this one is probably best to control with
> > the vsched (0.02) or the vcmd tool (which is non trivial to
> > use, I guess), but it would definitely be better to get this
> > functionality into mainline userspace tools ...
> >
> > http://vserver.13thfloor.at/Experimental/TOOLS/
>
> Thank you for the hint!
>
> --
> Wilhelm
_______________________________________________
Vserver mailing list
Vserver@list.linux-vserver.org
http://list.linux-vserver.org/mailman/listinfo/vserver
Received on Thu Jul 27 18:10:00 2006

[Next/Previous Months] [Main vserver Project Homepage] [Howto Subscribe/Unsubscribe] [Paul Sladen's vserver stuff]
Generated on Thu 27 Jul 2006 - 18:10:08 BST by hypermail 2.1.8