An Auto-starting vdbench Load Tester

An Auto-starting vdbench Load Tester



I have recently been testing the performance of some SANs and I wanted to come up with a way to produce an environment where I could replicate close to day to day operations. I decided to come up with a template that I could deploy to multiple VMs and emulate real IOs on the virtualised environment and thus test out the SANs performance.

The tools were simple:

Create a VM with CentOS installed. Nothing special. Just the base package.

Install some required packages

yum install java

Set the directory Structure

cd /root
mkdir vdbench
cd vdbench

Get vdbench

wget http://sourceforge.net/projects/vdbench/files/vdbench502.tar/download

Extract the TAR file

tar xvf vdbench502.tar

Create Paramater file

vim <your_param_filename>

Sample Parameters

sd=sd1,lun=/tmp/200MB_file.bin,size=200MB
wd=wd1,sd=sd1,xf=4k,seekpct=100,readpct=80
rd=rd1,wd=wd1,iorate=5000,elapsed=30,interval=1,forthreads=4

The Parameter file is made up of 3 section

  • Storage Definition – Identifies each physical or logical volume or file system file to be used
  • Workload Definition – Defines what kind of workload will be executed using the storage definitions listed above
  • Run Definition – Defines what I/O rate to be generated, and how long the workload will run
In the above example. We will be writing a 200MB file to the /tmp directory. It will use a 4kilobyte Data transfer size with 80% read and 20% write of which will be 100% random reads. It will run for 30 seconds with an average i/o rate of 5000iops. The interval will update every second.
Should you want to see how many IOPS you can get with the set parameters. You can set  iorate=max instead of a number.

 

Test the param file

/root/vdbench/vdbench -f /root/vdbench/params/<your_param_filename>

Turn off unwanted services

chkconfig sendmail off
chkconfig yum-updatesd off
chkconfig bluetooth off
chkconfig iptables off
chkconfig ip6tables off
chkconfig snmpd off
chkconfig smartd off
chkconfig firstboot off
chkconfig iscsi off
chkconfig iscsid off
chkconfig ntpd off

Set SELinux to disabled

vim /etc/selinux/config

Set

SELINUX=disabled

Create StartUp Script

cd /etc/init.d
vim <startup_script_name>

Set Script Attributes

chmod +x <startup_script_name>

Start Script for Starting vdbench

#!/bin/bash
/root/vdbench/vdbench -l -f /root/vdbench/params/<params_filename> >/dev/null &

Create Link for the Script to start on Boot in init 3

cd /etc/rc3.d
ln -s ../init.d/<statup_script_name> S99<YourscriptLabel>

And that should be it. Reboot your VM and you will  have vdbench start automatically.



Categories

  • Henk Vandenbergh

    Scott,

    interesting idea. One worry though: I am far from a Linux expert, but isn’t /tmp/ just run from memory, and, without any openflags= parameters used how do you guarantee disk i/o if it isn’t?

    Henk.

  • Henk,

    You make a valid point about the /tmp being loaded into memory. I have done some research since then and checked out my file system to see if the /tmp directory has been set to tempfs in the fstab but I see no reference. So I believe that this folder in CentOS is merely another directory. For the openflags=parameter. It seems I misunderstood its meaning and thought the flag was merely for use with a whole device and not useful to limit the amount of memory caching used.

    Thanks for the feedback

    Scott