diff options
| author | Fabian Mastenbroek <mail.fabianm@gmail.com> | 2020-03-16 22:37:06 +0100 |
|---|---|---|
| committer | Fabian Mastenbroek <mail.fabianm@gmail.com> | 2020-03-16 22:37:06 +0100 |
| commit | df088c89b43c4bcb5051c42906e91258ccd69ce5 (patch) | |
| tree | 907481fe3e2d2d7935ee7b4b6ffe14ed1ca012cb /opendc/opendc-compute | |
| parent | 7c2f254aacd17ee0e77a0b09a464baa8044b6c3a (diff) | |
| parent | 1e95d668eb21eece59a402f500a9e38ec51af596 (diff) | |
Merge branch '2.x-perf-interf-extension' into '2.x'
Extend performance interference model to support minimum server load
See merge request opendc/opendc-simulator!43
Diffstat (limited to 'opendc/opendc-compute')
| -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 |
