How to add Custom workloads to nfsometer permanently ?

In the previous article I have shown the usage of nfsometer including running the custom workload by exporting the command in variable. That method is not suitable if you want to add permanently new workload on server.

To add new workload permanently on server, please follow the below steps.

Step 1 : First check the current workloads available on server.

[root@localhost workloads]# nfsometer workloads
> Using results directory: /root/nfsometer_results
Available workloads:
cthon
dd_100m_100k
dd_100m_1k
filebench_fileserver
filebench_networkfs
filebench_varmail
filebench_webserver
gitclone
iozone
iozone_direct
kernel
python
Unavailable workloads:
bonnie++             – binary ‘bonnie++’ not found,
custom               – env variable ‘NFSOMETER_CMD’ not defined,

Step 2 : Go to below mentioned directory and list the content of directory you will be able to see all available workload in form of text files.

[root@localhost workloads]# pwd
/usr/lib/python2.7/site-packages/nfsometerlib/workloads

[root@localhost workloads]# ls
bonnie++.nfsometer  dd_100m_100k.nfsometer          filebench_networkfs.nfsometer  gitclone.nfsometer       kernel.nfsometer
cthon.nfsometer     dd_100m_1k.nfsometer            filebench_varmail.nfsometer    iozone_direct.nfsometer  python.nfsometer
custom.nfsometer    filebench_fileserver.nfsometer  filebench_webserver.nfsometer  iozone.nfsometer         workload.sh

Step 3 : I am creating my new file at this location and name of my file is “iotest.nfsometer”. I have shown you the content of the file. You can get the idea about the content from existing(default) files.

[root@localhost workloads]# cat iotest.nfsometer
COMMAND=”iozone -i 10 -t . -b 16384 -s 65536″
DESCRIPTION=”iotest.sh script running 10 dd threads each writing 16384 65536-byte blocks for a grand total of 10 GiB”

# workload_check()
#  – no arguments
#  – any output to stdout means the check failed
#  – use need_* functions from workloads.sh
workload_check()
{
need_bin iozone
}

# workload_setup()
#  – no arguments
#  – non-zero return indicates a problem
workload_setup()
{
return 0
}

Step 4 : Now in the below output I can see new workload is shown. You can compare in step 2 output no such workload was present. iotest.nfsometer created in step 3 will be shown as iotest only truncating .nfsometer

[root@localhost workloads]# nfsometer workloads | grep -i iotest
iotest

Step 5 : Lets create one more workload before ending this article.

[root@localhost workloads]# cat dd_10*1_g.nfsometer
COMMAND=$(cat <<EOF
dd if=/dev/zero of=./dd_file.1 bs=65536 count=16384 &
dd if=/dev/zero of=./dd_file.2 bs=65536 count=16384 &
dd if=/dev/zero of=./dd_file.3 bs=65536 count=16384 &
dd if=/dev/zero of=./dd_file.4 bs=65536 count=16384 &
dd if=/dev/zero of=./dd_file.5 bs=65536 count=16384 &
dd if=/dev/zero of=./dd_file.6 bs=65536 count=16384 &
dd if=/dev/zero of=./dd_file.7 bs=65536 count=16384 &
dd if=/dev/zero of=./dd_file.8 bs=65536 count=16384 &
dd if=/dev/zero of=./dd_file.8 bs=65536 count=16384 &
dd if=/dev/zero of=./dd_file.8 bs=65536 count=16384 &
wait
EOF
)
DESCRIPTION=”A run of 10 concurrent dd(1)’s each writing a 1 GiB file of zeros in 65536-byte blocks”

# workload_check()
#  – no arguments
#  – any output to stdout means the check failed
#  – use need_* functions from workloads.sh
workload_check()
{
need_bin dd
}

# workload_setup()
#  – no arguments
#  – non-zero return indicates a problem
workload_setup()
{
return 0
}

Step 6 : As expected we can see the new workload in below output.

[root@localhost workloads]# nfsometer workloads | grep dd_10
dd_10*1_g                            <<<< New one.
dd_100m_100k
dd_100m_1k

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s