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.
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 iperf.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/iperf /usr/lib/vmware/vsan/bin/iperf.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/iperf.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/iperf -m -i t300 -c [IPERF-SERVER] -fm
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.