Martin Sivák has posted comments on this change. Change subject: WIP Update balancers and add memory based load balancing ......................................................................
Patch Set 1: (7 comments) https://gerrit.ovirt.org/#/c/38189/1/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/scheduling/policyunits/CpuAndMemoryBalancingPolicyUnit.java File backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/scheduling/policyunits/CpuAndMemoryBalancingPolicyUnit.java: Line 57: int hostCount = hosts == null ? 0 : hosts.size(); Line 58: log.debug("No balancing for cluster '{}', contains only {} host(s)", cluster.getName(), hostCount); Line 59: return null; Line 60: } Line 61: // get vds that over committed for the time defined > minor - /** instead of // Done Line 62: /* returns list of Hosts with Line 63: * cpuUtilization >= highUtilization Line 64: * && cpuOverCommitMinutes >= CpuOverCommitDurationMinutes Line 65: */ https://gerrit.ovirt.org/#/c/38189/1/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/scheduling/policyunits/EvenDistributionWeightPolicyUnit.java File backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/scheduling/policyunits/EvenDistributionWeightPolicyUnit.java: Line 50: score = Math.min((int) Math.round( Line 51: calcDistributeMetric(vds, vm, effectiveCpuCores)) + 1, MaxSchedulerWeight); Line 52: } Line 53: Line 54: // TODO Each 100 MB of free memory is equal to 1% of free CPU > equals in terms of score? 100MB is also a score of 1? Yes, in terms of score. And yes 100MB of free RAM is assumed to be equal as 1% of free CPU in this draft. Line 55: score -= vds.getMaxSchedulingMemory() / 100; Line 56: Line 57: return score; Line 58: } https://gerrit.ovirt.org/#/c/38189/1/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/scheduling/policyunits/PowerSavingBalancePolicyUnit.java File backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/scheduling/policyunits/PowerSavingBalancePolicyUnit.java: Line 258: return null; Line 259: } Line 260: Line 261: @Override Line 262: protected FindVmAndDestinations getFindVmAndDestinations(VDSGroup cluster, Map<String, String> parameters) { > hard to read. please use the eclipse formatter file under config/ directory Done Line 263: final int highUtilization = tryParseWithDefault(parameters.get("HighUtilization"), Config Line 264: .<Integer> getValue(ConfigValues.HighUtilizationForPowerSave)); Line 265: final long overUtilizedMemory = parameters.containsKey(EvenDistributionBalancePolicyUnit.LOW_MEMORY_LIMIT_FOR_OVER_UTILIZED) ? Line 266: Long.valueOf(parameters.get(EvenDistributionBalancePolicyUnit.LOW_MEMORY_LIMIT_FOR_OVER_UTILIZED)) : 0L; https://gerrit.ovirt.org/#/c/38189/1/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/scheduling/utils/FindVmAndDestinations.java File backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/scheduling/utils/FindVmAndDestinations.java: Line 94: * @param vmDAO The data source to get the VM information Line 95: * @param hostId Id of a host the returned VMs run at Line 96: * @return list od VM that run on host and can be migrated Line 97: */ Line 98: private List<VM> getMigrableVmsRunningOnVds(final VmDAO vmDAO, final Guid hostId) { > s/Migrable/Migratalbe Done Line 99: List<VM> vmsFromDB = vmDAO.getAllRunningForVds(hostId); Line 100: Line 101: List<VM> vms = LinqUtils.filter(vmsFromDB, new Predicate<VM>() { Line 102: @Override Line 94: * @param vmDAO The data source to get the VM information Line 95: * @param hostId Id of a host the returned VMs run at Line 96: * @return list od VM that run on host and can be migrated Line 97: */ Line 98: private List<VM> getMigrableVmsRunningOnVds(final VmDAO vmDAO, final Guid hostId) { > s/Migrable/Migratable Done Line 99: List<VM> vmsFromDB = vmDAO.getAllRunningForVds(hostId); Line 100: Line 101: List<VM> vms = LinqUtils.filter(vmsFromDB, new Predicate<VM>() { Line 102: @Override https://gerrit.ovirt.org/#/c/38189/1/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/scheduling/utils/VdsCpuUsageComparator.java File backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/scheduling/utils/VdsCpuUsageComparator.java: Line 8: /** Line 9: * Comparator that compares the CPU usage of two hosts, with regard to the number of CPUs each host has and it's Line 10: * strength. Line 11: */ Line 12: public final class VdsCpuUsageComparator implements Comparator<VDS> { > thanks for extracting those out. I'd make those static as we don't need a n Done Line 13: @Override Line 14: public int compare(VDS o1, VDS o2) { Line 15: return Integer.valueOf(calculateCpuUsage(o1)).compareTo(calculateCpuUsage(o2)); Line 16: } https://gerrit.ovirt.org/#/c/38189/1/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/scheduling/utils/VmCpuUsageComparator.java File backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/scheduling/utils/VmCpuUsageComparator.java: Line 6: Line 7: /** Line 8: * Comparator that compares the CPU usage of two VMs, with regard to the number of CPUs each VM has. Line 9: */ Line 10: public final class VmCpuUsageComparator implements Comparator<VM> { > also make static Done Line 11: @Override Line 12: public int compare(VM o1, VM o2) { Line 13: return Integer.valueOf(calculateCpuUsage(o1)).compareTo(calculateCpuUsage(o2)); Line 14: } -- To view, visit https://gerrit.ovirt.org/38189 To unsubscribe, visit https://gerrit.ovirt.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I1fe13267feca89ab6c8fb9d85656f05930d0b333 Gerrit-PatchSet: 1 Gerrit-Project: ovirt-engine Gerrit-Branch: master Gerrit-Owner: Martin Sivák <[email protected]> Gerrit-Reviewer: Martin Sivák <[email protected]> Gerrit-Reviewer: Roy Golan <[email protected]> Gerrit-Reviewer: Tomer Saban <[email protected]> Gerrit-Reviewer: [email protected] Gerrit-Reviewer: oVirt Jenkins CI Server Gerrit-HasComments: Yes _______________________________________________ Engine-patches mailing list [email protected] http://lists.ovirt.org/mailman/listinfo/engine-patches
