From 1e95d668eb21eece59a402f500a9e38ec51af596 Mon Sep 17 00:00:00 2001 From: Georgios Andreadis Date: Mon, 16 Mar 2020 09:23:52 +0100 Subject: Extend performance interference model to support minimum server load Vincent pointed out that performance interference is only triggered at a certain total server load level. This addition supports that. --- .../opendc/compute/virt/driver/hypervisor/HypervisorVirtDriver.kt | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'opendc/opendc-compute') diff --git a/opendc/opendc-compute/src/main/kotlin/com/atlarge/opendc/compute/virt/driver/hypervisor/HypervisorVirtDriver.kt b/opendc/opendc-compute/src/main/kotlin/com/atlarge/opendc/compute/virt/driver/hypervisor/HypervisorVirtDriver.kt index 7cd48bc3..430e5a37 100644 --- a/opendc/opendc-compute/src/main/kotlin/com/atlarge/opendc/compute/virt/driver/hypervisor/HypervisorVirtDriver.kt +++ b/opendc/opendc-compute/src/main/kotlin/com/atlarge/opendc/compute/virt/driver/hypervisor/HypervisorVirtDriver.kt @@ -145,6 +145,7 @@ class HypervisorVirtDriver( val burst = LongArray(hostContext.cpus.size) val totalUsage = maxUsage - availableUsage availableUsage = totalUsage + val serverLoad = totalUsage / maxUsage // Divide the requests over the available capacity of the pCPUs fairly for (i in hostContext.cpus.indices.sortedBy { hostContext.cpus[it].frequency }) { @@ -174,8 +175,9 @@ class HypervisorVirtDriver( for (vm in vms) { // Apply performance interference model - val performanceModel = vm.server.image.tags[IMAGE_PERF_INTERFERENCE_MODEL] as? PerformanceInterferenceModel? - val performanceScore = performanceModel?.apply(imagesRunning) ?: 1.0 + val performanceModel = + vm.server.image.tags[IMAGE_PERF_INTERFERENCE_MODEL] as? PerformanceInterferenceModel? + val performanceScore = performanceModel?.apply(imagesRunning, serverLoad) ?: 1.0 for ((i, req) in vm.requests.withIndex()) { // Compute the fraction of compute time allocated to the VM -- cgit v1.2.3