Performance Metrics in Virtualization: Network Throughput

Michael Zhao
2 min readSep 21, 2022

--

How is the virtual network throughput performance measured in a virtualization platform?

This article introduces how it’s done in Cloud Hypervisor.

Why Measure?

In Cloud Hypervisor, a NIC in the guest VM could be either:

  • A virtio-net device
  • A passthrough device from the host

Measuring the throughput of the device matters for both cases.

The performance metrics report can show you the bandwidth that the device can make.

How Metrics Works?

The following diagram illustrates how the measuring is performed.

iPerf3 is used to measure the throughput.

In the guest VM, an iPerf3 server is launched. It listens to the specified port for traffic.

~ # -s: server
~ # -p: port
~ # -D: daemon
~ iperf3 -s -p 1912 -D

In the host, a iPerf3 client is started to exchange traffic with the server:

~ # -c: connection address
~ # -p: port
~ # -t: timeout
~ iperf3 -c 10.169.214.127 -p 1912 -t 10

The client side will keep printing instant data in 10 seconds, like:

In this case, the average Bandwidth reached 12.0 Gbits/sec.

Want To Try?

If you want to test as well, clone the repository at first: https://github.com/cloud-hypervisor/cloud-hypervisor. A guideline document is here to follow for the performance metrics.

This instruction will run all the throughput test cases:

~ ./scripts/dev_cli.sh tests --metrics -- -- --report-file /tmp/metrics.json --test-filter virtio_net_throughput

Reference

--

--

Michael Zhao
Michael Zhao

Written by Michael Zhao

Major in virtualization, security and ARM.

No responses yet