Benchmark test on Linux Virtual Machine in Azure

Promise Nwachukwu
Azure Nigeria Community Group
3 min readNov 2, 2022

--

Figure 1: Benchmark assessment on Azure

We will be focusing on these areas when looking at benchmark/load assessment and throughput optimization on Azure:

  1. Load Assessment on a virtual machine using a Linux OS
  2. Benchmarking a disk
  3. Tools for performing a benchmark test on Azure:
    Diskspd Utility Test
    FIO Test

Load Assessment on a virtual machine using a Linux OS

Figure 2: Picture of Top Command

When talking about load assessment on a Linux OS, this helps you to understand how your Virtual Machine behaves when it is under a high load pressure.
Some of the symptoms noticed when this happens is that process execution takes a longer time as the VM has a small amount of memory to share between the tasks being executed.

In carrying out load assessment, it is also important to know how the load is distributed between the CPUs on the VM.
First, you will need to run the “top” command which will display a screen as seen in the above picture. If you have more than one CPU, you may need to find out the average load distribution among them, you can do this by pressing the number “1” just after the top command screen is displayed.

To find out how the processes are distributed between the CPU’s, run the command “ps -Fae” on the linux machine and it will display each process running and which CPU it is attached to.

You can also get a preview of the processes running on your VM and what processors they are running on.

Benchmarking a Disk

Benchmarking is the process of simulating different workloads on your application and measuring the application performance for each workload.

To put it in simple words , it’s a way of carrying out a test on your disk to determine it’s expected set of values (IOPS and throughput) when used under specific conditions.

To benchmark a disk in Azure, it is required to use the recommended tools by Microsoft such as diskspd utility (Windows OS) and FIO (Linux OS).

Tools for Performing a Benchmarking test on Azure

  1. Diskspd utility

This is a feature-rich and versatile storage testing tool. Diskspd (version 2.0.17) combines robust and granular IO workload definition with flexible runtime and output options, creating an ideal tool for synthetic storage subsystem testing and validation.

A sample command to carryout the diskspd test can be seen below:
diskspd –b8K –d30 –o4 –t8 –h –r –w25 –L –Z1G –c20G T:\iotest.dat > DiskSpeedResults.txt

2. FIO Tool

This is a popular tool to benchmark storage on the Linux VMs. It has the flexibility to select different IO sizes, sequential or random reads and writes.

It spawns worker threads or processes to perform the specified I/O operations. You can specify the type of I/O operations each worker thread must perform using job files.

A sample command to carry out an FIO test on a Linux machine can be seen as below:
sudo fio — directory=/data — name=randrw2.dat — ioengine=libaio — iodepth=64 — rw=randwrite — bs=4k — direct=1 — size=1024M

I hope you have been able to get some information on carrying out a Benchmark/Load assessment and throughput optimization in Azure and I hope you found this interesting.

References:

--

--