Skip to content

Add MigrationCheckBenchmark for cloudsimplus#94 - #21

Open
manoelcampos wants to merge 1 commit into
masterfrom
migration-check-benchmark
Open

manoelcampos wants to merge 1 commit into
masterfrom
migration-check-benchmark

Conversation

@manoelcampos

Copy link
Copy Markdown
Contributor

Part of cloudsimplus/cloudsimplus#94. Related to cloudsimplus/cloudsimplus#648 and cloudsimplus/cloudsimplus#652.

Adds MigrationCheckBenchmark, a JMH benchmark that measures one VM migration check: a call to VmPlacementPolicyMigrationAbstract.getOptimizedPlacementMap(). It's the baseline to compare against after the #94 refactor, which stops creating and destroying VMs to compute the migration map.

Scenario

  • Hosts with 8 cores. In each group of 10 Hosts, 1 is overloaded (4 VMs using 100% of the CPU), 1 is underloaded (a VM with 1 core) and 8 use half of their CPU (2 VMs with 2 cores).
  • VmPlacementPolicyMigrationStaticThreshold (thresholds 0.8 and 0.2) with VmSelectionPolicyMinimumUtilization.
  • Migrations are disabled in the Datacenter, so only the benchmark runs the check.
  • Run with -prof gc to also get the memory allocated per check.

Results on CloudSim Plus master (4a160b4bb)

JDK 25.0.4, JMH 1.35, 1 fork, 5 warmup and 10 measurement iterations of 2 seconds.

Hosts VMs Time per check (ms) Allocated per check (MB)
100 210 4.07 ± 0.07 18.3
500 1,050 102.75 ± 2.35 454.9
1,000 2,100 428.46 ± 14.58 1,818.2
2,000 4,200 1,802.05 ± 31.41 7,268.5

Both the time and the memory allocated by a check grow quadratically: doubling the number of Hosts makes a check about 4 times slower and allocate about 4 times more memory.

While #94 isn't fixed, the first check changes the placement: VMs planned to leave underloaded Hosts are left in their target Hosts too, and some VMs are removed from the broker's list of running VMs. The state stops changing after the first check, so the warmup iterations make every measured check start from the same placement. This is documented in the benchmark.

Engineering principles

Principle How it applies
SRP Small helpers build the Hosts, the VM specs, the VMs and the Cloudlets
DRY A VmSpec record keeps each VM's Host, cores and CPU utilization in one place, used to create both the VM and its Cloudlet

🤖 Generated with Claude Code

Measure the time and memory allocated by one VM migration check
(VmPlacementPolicyMigrationAbstract.getOptimizedPlacementMap()) with
overloaded, underloaded and half used Hosts, for 100 to 2,000 Hosts.
It's the baseline for cloudsimplus#94 and cloudsimplus#648.

The README has the results for CloudSim Plus master (4a160b4bb):
both time and allocated memory grow quadratically with the number
of Hosts (1.8 s and 7.3 GB per check with 2,000 Hosts).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant