VDBench to Benchmark your VMware Datastore
If you have built a VMware ESXi server or cluster with a datastore or multiple datastores, you may want to see if the IOPs with the datastore are what they are supposed to be, or you may not know what performance the hardware and configuration are capable of. You can use a tool called vdbench to benchmark your environment.
Table of contents
What is vdbench?
Let’s look at a brief overview of what vdbench is and what it can do. It is a command line utility that you can use to generate synthetic disk I/O workloads that helps to test out and validate your storage performance and make sure it does what it should do. Validating your storage on the outset can help to protect your storage data integrity.
It is also common to see vdbench used to help with troubleshooting and to identify data corruption issues, data validation, and to help validate storage performance. By running vdbench and adjusting workload parameters and storage definitions you will be able to tweak your storage and use the results of the tests to improve performance.
While the title is using vdbench to benchmark your VMware datastore, it is not a VMware-specific tool and is actually produced as a free download by Oracle of all people, but it is also used to tweak java virtual machines. It is written in Java and can be run in several different operating systems, including Windows, Linux, Mac OS X, Raspberry Pi, etc.
What it can do
vdbench can generate storage I/O workloads that are controlled by you so that you can specify the types of workloads you want to simulate. You can control the following to name a few:
- I/O rate
- LUN or file sizes
- Transfer sizes
- Thread count
- volume count
- volume skew
- read/write ratios
- read and write cache hit percentages
- random workloads
- sequential workloads
Where can you download it?
You can download it from the official link from Oracle here: Vdbench Downloads (oracle.com). Unfortunately, you will need to provide an email address to get access to the download, but this is a free signup and doesn’t have any nags associated with it from what I can tell.
vdbench Test Definition Files
Vdbench input templates are basically an input text file that has 3 main sections and it defines the vdbench execution parameters for testing:
- Storage Definition (SD) – this part of the template will set the characteristics of the storage device that is being tested. It will include things like lun, size, openflags, threads, range, etc. An example is sd=sd1,lun=/dev/sda,size=100g (This sets up a test on a storage device (sd1) pointing to /dev/sda with a size of 100 GB.)
- Workload Definition (WD) – This part configures the I/O that will be tested against the storage in the storage definition section. It sets up the read/write ratio, block size, the I/O patterns it will use, and other configuration to set up how the storage will be benchmarked. It has parameters like sd, rdpct, seekpct, xfersize, iorate, etc. An example of this would be wd=wd1,sd=sd1,rdpct=70,xfersize=4k,seekpct=100 (This defines a workload (wd1) that performs 70% read operations with 4KB block sizes and 100% random access on the storage device sd1.)
- Run Definition (RD) – this part controls the actual benchmark execution. It sets up the duration of the test, the type of workload, and how workloads and storage definitions are combined for the benchmark. It includes parameters like wd, iorate, elapsed, interval, warmup, etc. An example would be rd=run1,wd=wd1,iorate=max,elapsed=30m,interval=1s (This sets up a run (run1) where the workload wd1 is executed at the maximum I/O rate for 30 minutes with statistics gathered every second.)
Also, there are sample parameter files contained in the download from Oracle, under the examples > raw folder.
Running vdbench manually
You can download vdbench from Oracle directly as it is provided by a ZIP file download containing what you need to run vdbench.
Download vdbench from the Oracle Technology Network (OTN) website. It is a ZIP file download, so you will need to extract it.
To just run a simple quick test for raw I/O or file system test, you can use the following commands without needing to create a parameter file in your install directory.=
./vdbench โt (for a raw I/O workload)
./vdbench โtf (for a file system workload)
You can also use the following:
- Use the -f flag for the input test definition file.
- Use the -o flag for the output directory that will contain the results.
- The input definition file name should conform to a specific format.
- The output directory name should conform to a specific format.
- It will generate and create HTML files which will include Summary.html, Totals.html, Logfile.html, Kstat.html, Histogram.html, and Flatfile.html.
VMware HCIbench includes vdbench
There is an easier way to run HCI bench on your VMware vSphere datastores to test performance and that is with a tool called HCIbench. One of the benchmark tools included in HCIbench is vdbench. So, you can let HCIbench orchestrate the deployment of test VMs on your VMware datastore and use vdbench with a sample parameter file to simulate an actual workload on your datastore.
Download HCIbench
You can download HCIbench here: GitHub – vmware-labs/hci-benchmark-appliance.
These types of tests help in validating storage performance so you know that things are in line with what you are expecting with new infrastructure, storage array, etc.
Overview of running it
There are a few steps to do to get to the point of running a benchmark. You need to:
- download and deploy the OVA appliance into your vSphere environment
- The actual OVA doesn’t have to be deployed on the infrastructure you want to test as you can spin up these workloads anywhere
- Once you have the OVA appliance deployed and configured, connect to the web interface using a browser and connect to port 8443.
Running HCIbench and choosing the vdbench tool
Below, when you are setting up your run, you can see you can choose vdbench under the “Choose the benchmarking tool.”
Once you kick off a run of vdbench using hcibench, you will see it start the deployment of test virtual machines that match the specs of the VMs configured in the screen above.
Once the test is complete, you can review the result of the test.
One of the really cool things you can do while running HCIbench is you can have a realtime view of the test itself. When the test kicks off, it will provide you with a clickable link to view the workload test. This will take you to a grafana dashboard showing all the relevant metrics that most will want to see.
Pretty cool below to see an MS-A1 with a Samsung 980 2TB drive getting 140k IOPs ๐
Wrapping up
The vdbench tool is a great tool for running benchmarks against many types of environments, from single computers and PCs, to servers, and to other types of systems like virtualization clusters. It can test a wide range of storage types and can be used to pinpoint problem areas with storage infrastructure, among others. It is also extremely fun to play around with in the home lab to see what types of results you can get with home lab storage and infrastructure.