[openstack-dev] Weight normalization in scheduler
Álvaro López García
alvaro.lopez.garcia at cern.ch
Thu Aug 1 12:51:55 UTC 2013
On Thu 01 Aug 2013 (09:07), Sandy Walsh wrote:
>
>
> On 08/01/2013 04:24 AM, Álvaro López García wrote:
> > Hi all.
> >
> > TL;DR: I've created a blueprint [1] regarding weight normalization.
> > I would be very glad if somebody could examine and comment it.
>
> Something must have changed. It's been a while since I've done anything
> with the scheduler, but normalized weights is the way it was designed
> and implemented.
It seems reasonable, but it is not there anymore:
class RAMWeigher(weights.BaseHostWeigher):
(...)
def _weigh_object(self, host_state, weight_properties):
"""Higher weights win. We want spreading to be the default."""
return host_state.free_ram_mb
> The separate Weighing plug-ins are responsible for taking the specific
> units (cpu load, disk, ram, etc) and converting them into normalized
> 0.0-1.0 weights. Internally the plug-ins can work however they like, but
> their output should be 0-1.
With the current code, this is not true. Anyway, I think this responsability
should be implemented in the BaseWeightHandler rather than each weigher.
This way each weigher can return whatever they want, but we will be
always using a correct value.
> The multiplier, however, could scale this outside that range (if disk is
> more important than cpu, for example).
Yes, of course, since the multiplier is applied *after* normalizing the
weights.
> Actually, I remember it being offset + scale * weight, so you could put
> certain factors in bands: cpu: 1000+, disk: 10000+, etc. Hopefully
> offset is still there too?
No, it is not.
Thanks,
--
Álvaro López García aloga at ifca.unican.es
More information about the OpenStack-dev
mailing list