diff options
| author | Georgios Andreadis <info@gandreadis.com> | 2020-03-16 09:23:52 +0100 |
|---|---|---|
| committer | Georgios Andreadis <info@gandreadis.com> | 2020-03-16 09:23:52 +0100 |
| commit | 1e95d668eb21eece59a402f500a9e38ec51af596 (patch) | |
| tree | 6c8ce500665603df00c04c5354b307b645fa1b82 /opendc/opendc-compute/src | |
| parent | ccde4082af2d32da0332b6b87741a73d9b01f587 (diff) | |
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.
Diffstat (limited to 'opendc/opendc-compute/src')
| -rw-r--r-- | opendc/opendc-compute/src/main/kotlin/com/atlarge/opendc/compute/virt/driver/hypervisor/HypervisorVirtDriver.kt | 6 |
1 files changed, 4 insertions, 2 deletions
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 |
