The other day I was looking to get a baseline of the built-in ethernet adapter of my recently upgraded vSphere home lab running on the Intel NUC. I decided to use iPerf for my testing which is a commonly used command-line tool to help measure network performance. I also found a couple of articles from well known VMware community members: Erik Bussink and Raphael Schitz on this topic as well which were quite helpful. Erik's article here outlines how to run the iPerf Client/Server using a pair of Virtual Machines running on top of two ESXi hosts. Although the overhead of the VMs should be negligible, I was looking for a way to benchmark the ESXi hosts directly. Raphael's article here looked promising as he found a way to create a custom iPerf VIB which can run directly on ESXi.
I was about to download the custom VIB and I had just remembered that the VSAN Health Check plugin in the vSphere Web Client also provides some proactive network performance tests to be run on your environment. I was curious on what tool was being leveraged for this capability and in doing a quick search on the ESXi filesystem, I found that it was actually iPerf. The iPerf binary is located in /usr/lib/vmware/vsan/bin/iperf and looks to have been bundled as part of ESXi starting with the vSphere 6.0 release from what I can tell.
UPDATE (10/19/23) - As of ESXi 8.x, you may run into following error when attempting to start running iperf:
iperf3: running in appDom(30): ipAddr = ::, port = 5201: Access denied by vmkernel access control policy
To workaround this, you can run the following command:
esxcli system secpolicy domain set -n appDom -l disabled
and re-enable once you have completed your iperf test both on the server and client ESXi host.
UPDATE (09/20/22) - As of ESXi 7.0 Update 3 20036589 (possibly earlier) and later, you no longer need to make a copy of the iperf3 utility. You can simply run it from /usr/lib/vmware/vsan/bin/iperf3 and you also do NOT have to lower the security by changing ESXi Advanced Setting execInstalledOnly to FALSE
UPDATE (10/02/18) - It looks like iPerf3 is now back in both ESXi 6.5 Update 2 as well as the upcoming ESXi 6.7 Update 1 release. You can find the iPerf binary under /usr/lib/vmware/vsan/bin/iperf3
One interesting thing that I found when trying to run iPerf in "server" mode is that you would always get the following error:
bind failed: Operation not permitted
The only way I found to fix this issue was to basically copy the iPerf binary to another file like iperf3.copy which it would then allow me to start iPerf in "server" mode. You can do so by running the following command on the ESXi Shell:
cp /usr/lib/vmware/vsan/bin/iperf3 /usr/lib/vmware/vsan/bin/iperf3.copy
Running iPerf in "Client" mode works as expected and the copy is only needed when running in "server" mode. To perform the test, I used both my Apple Mac Mini and the Intel NUC which had ESXi running with no VMs.
I ran the iPerf "Server" on the Intel NUC by running the following command:
/usr/lib/vmware/vsan/bin/iperf3.copy -s -B [IPERF-SERVER-IP]
Note: If you have multiple network interfaces, you can specify which interface to use with the -B option and passing the IP Address of that interface.
I ran the iPerf "Client" on the Mac Mini by running the following command and specifying the address of the iPerf "Server":
/usr/lib/vmware/vsan/bin/iperf3 -n 800M -c [IPERF-SERVER]
I also disabled the ESXi firewall before running the test, which you can do by running the following command:
esxcli network firewall set --enabled false
Here is a screenshot of my iPerf test running between my Mac Mini and Intel NUC. Hopefully this will come in handy for anyone needing to run some basic network performance tests between two ESXi hosts without having to setup additional VMs.