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:
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