FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > Redhat > Fedora Build System

 
 
LinkBack Thread Tools
 
Old 06-07-2011, 08:05 AM
Anthony Towns
 
Default Koji host selection/load balancing

Hi,

The host selection algorithm in koji/daemon.py (TaskManager.checkRelAvail) is designed to choose a host that's in the top half of hosts by most available capacity. I think it doesn't quite work as might be expected though -- in the case where you have five hosts all with a capacity of 3.0, you could have the following behaviour:

A takes job, capacities: [3.0, 3.0, 3.0, 3.0, 2.0] (median = 3.0)
B takes job, capacities: [3.0, 3.0, 3.0, 2.0, 2.0] (median = 3.0)
C takes job, capacities: [3.0, 3.0, 2.0, 2.0, 2.0] (median = 2.0)
A takes job, capacities: [3.0, 3.0, 2.0, 2.0, 1.0] (median = 2.0)
B takes job, capacities: [3.0, 3.0, 2.0, 1.0, 1.0] (median = 2.0)
C takes job, capacities: [3.0, 3.0, 1.0, 1.0, 1.0] (median = 1.0)
A takes job, capacities: [3.0, 3.0, 1.0, 1.0] (median = 3.0)
D takes job, capacities: [3.0, 2.0, 1.0, 1.0] (median = 2.0)
D takes job, capacities: [3.0, 1.0, 1.0, 1.0] (median = 1.0)
B takes job, capacities: [3.0, 1.0, 1.0] (median = 1.0)
C takes job, capacities: [3.0, 1.0] (median = 3.0)

So eleven jobs get divided up as:

3 on A
3 on B
3 on C
2 on D
0 on E

This is because the >=median test doesn't actually ensure this host is in the top half, just that there's a host in the top half that's no better than this one. I think a better test would be ==best or >median, in which case you'd get:

A takes job, capacities: [3.0, 3.0, 3.0, 3.0, 2.0]
B takes job, capacities: [3.0, 3.0, 3.0, 2.0, 2.0]
C takes job, capacities: [3.0, 3.0, 2.0, 2.0, 2.0]
D takes job, capacities: [3.0, 2.0, 2.0, 2.0, 2.0]
E takes job, capacities: [2.0, 2.0, 2.0, 2.0, 2.0]

Patch attached for consideration.

Cheers,
aj

--
Anthony Towns <atowns@redhat.com>--
buildsys mailing list
buildsys@lists.fedoraproject.org
https://admin.fedoraproject.org/mailman/listinfo/buildsys
 

Thread Tools




All times are GMT. The time now is 02:33 AM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright 2007 - 2008, www.linux-archive.org