How to use nfsometer for NFS performance testing ?

In this article I am going to show you the usage of nfsometer tool which is available in RHEL 7 for NFS performance testing. I personally found nfsometer is the complete tool for nfs performance testing while in earlier version of RHEL we were having command like nfsstat and nfsiostat to measure the performance sometime which were not suffice the testing requirement. These tools are still available in  RHEL 7, but nfsometer will provide you everything you are looking for nfs performance measurement.

Step 1 : nfsometer has various kind of workloads available inbuilt.  Some workloads are listed in non-available workloads category once you installed the package they will be moved the Available workloads.

RHEL7# 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
kernel
python
Unavailable workloads:
bonnie++             – binary ‘bonnie++’ not found,
custom               – env variable ‘NFSOMETER_CMD’ not defined,
iozone               – binary ‘iozone’ not found,
iozone_direct        – binary ‘iozone’ not found,
Step 2 : I have installed the iozone package on server after that I can see that iozone has moved from Unavailable workloads to available workloads.

RHEL7# wget ftp://195.220.108.108/linux/dag/redhat/el7/en/x86_64/dag/RPMS/iozone-3.424-2.el7.rf.x86_64.rpm

RHEL7# rpm -ivh iozone-3.424-2.el7.rf.x86_64.rpm
warning: iozone-3.424-2.el7.rf.x86_64.rpm: Header V3 DSA/SHA1 Signature, key ID 6b8d79e6: NOKEY
Preparing…                          ################################# [100%]
Updating / installing…
1:iozone-3.424-2.el7.rf            ################################# [100%]

RHEL7# 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 3 : I have mounted one share on RHEL 7 server for testing but for nfsometer you don’t require to mount the share.

RHEL7# mount -t nfs -o vers=3 192.168.111.155:/export /nfsshare1

RHEL7# df -h /nfsshare1/
Filesystem               Size  Used Avail Use% Mounted on
192.168.111.155:/export   20G   44M   19G   1% /nfsshare1

Step 4 : While running my first test I have unmounted the NFS share and ran the test without giving any option. Below are the results of that test.

[root@localhost ~]# nfsometer -o v3 192.168.111.155:/export
> Using results directory: /root/nfsometer_results
> Probing 192.168.111.155:/export: v3
Mounting: 192.168.111.155:/export (options: v3)…
Unmounting: 192.168.111.155:/export…
Fetching git: git://git.linux-nfs.org/projects/trondmy/linux-nfs
Cloning into ‘linux-nfs’…
remote: Counting objects: 4497144, done.
remote: Compressing objects: 100% (758026/758026), done.
remote: Total 4497144 (delta 3707065), reused 4497091 (delta 3707012)
Receiving objects: 100% (4497144/4497144), 981.88 MiB | 208.00 KiB/s, done.
Resolving deltas: 100% (3707065/3707065), done.
Checking out files: 100% (49456/49456), done.
Fetching url: http://python.org/ftp/python/2.7.2/Python-2.7.2.tgz
–2015-05-30 09:22:06–  http://python.org/ftp/python/2.7.2/Python-2.7.2.tgz
Resolving python.org (python.org)… 104.130.43.121, 2001:4802:7901:0:e60a:1375:0:5
Connecting to python.org (python.org)|104.130.43.121|:80… connected.
HTTP request sent, awaiting response… 301 Moved Permanently
Location: https://python.org/ftp/python/2.7.2/Python-2.7.2.tgz [following]
–2015-05-30 09:22:07–  https://python.org/ftp/python/2.7.2/Python-2.7.2.tgz
Connecting to python.org (python.org)|104.130.43.121|:443… connected.
HTTP request sent, awaiting response… 301 Moved Permanently
Location: https://www.python.org/ftp/python/2.7.2/Python-2.7.2.tgz [following]
–2015-05-30 09:22:08–  https://www.python.org/ftp/python/2.7.2/Python-2.7.2.tgz
Resolving http://www.python.org (www.python.org)… 103.245.222.223
Connecting to http://www.python.org (www.python.org)|103.245.222.223|:443… connected.
HTTP request sent, awaiting response… 200 OK
Length: 14091337 (13M) [application/octet-stream]
Saving to: ‘Python-2.7.2.tgz’

100%[===================================================================================================>] 14,091,337   208KB/s   in 67s

2015-05-30 09:23:15 (207 KB/s) – ‘Python-2.7.2.tgz’ saved [14091337/14091337]

Fetching url: http://www.kernel.org/pub/linux/kernel/v3.0/linux-3.4.tar.bz2
–2015-05-30 09:23:15–  http://www.kernel.org/pub/linux/kernel/v3.0/linux-3.4.tar.bz2
Resolving http://www.kernel.org (www.kernel.org)… 199.204.44.194, 149.20.4.69, 198.145.20.140, …
Connecting to http://www.kernel.org (www.kernel.org)|199.204.44.194|:80… connected.
HTTP request sent, awaiting response… 301 Moved Permanently
Location: https://www.kernel.org/pub/linux/kernel/v3.0/linux-3.4.tar.bz2 [following]
–2015-05-30 09:23:16–  https://www.kernel.org/pub/linux/kernel/v3.0/linux-3.4.tar.bz2
Connecting to http://www.kernel.org (www.kernel.org)|199.204.44.194|:443… connected.
HTTP request sent, awaiting response… 200 OK
Length: 80173484 (76M) [application/x-bzip2]
Saving to: ‘linux-3.4.tar.bz2’

100%[===================================================================================================>] 80,173,484   213KB/s   in 6m 20s

2015-05-30 09:29:37 (206 KB/s) – ‘linux-3.4.tar.bz2’ saved [80173484/80173484]

Requested: 12 workloads X 1 options X 1 runs = 12 traces
Need to run 12 of 12 requested traces
dd_100m_100k – needs 1 runs of v3
filebench_fileserver – needs 1 runs of v3
filebench_varmail – needs 1 runs of v3
gitclone – needs 1 runs of v3
iozone – needs 1 runs of v3
dd_100m_1k – needs 1 runs of v3
filebench_webserver – needs 1 runs of v3
python – needs 1 runs of v3
filebench_networkfs – needs 1 runs of v3
kernel – needs 1 runs of v3
cthon – needs 1 runs of v3
iozone_direct – needs 1 runs of v3

> Trace 1/12: 1 of 1 for dd_100m_100k: v3

< SETUP WORKLOAD >
Mounting: 192.168.111.155:/export (options: v3)…
removing run directory…done
Unmounting: 192.168.111.155:/export…

< RUN WORKLOAD >
Mounting: 192.168.111.155:/export (options: v3)…
Running command: dd if=/dev/zero of=./dd_file.100m_100k bs=102400 count=1024
Unmounting: 192.168.111.155:/export…
Results copied to: nfsometer_trace-dd_100m_100k-localhost.localdomain-1432999779.13

> Trace 2/12: 1 of 1 for filebench_fileserver: v3

< SETUP WORKLOAD >
Mounting: 192.168.111.155:/export (options: v3)…
removing run directory…done
Unmounting: 192.168.111.155:/export…

< RUN WORKLOAD >
Mounting: 192.168.111.155:/export (options: v3)…
Running command: cd /root/.nfsometer/workload_files/filebench_fileserver && filebench -f nfsometer-fileserver.f
Unmounting: 192.168.111.155:/export…
Results copied to: nfsometer_trace-filebench_fileserver-localhost.localdomain-1433000179.0

> Trace 3/12: 1 of 1 for filebench_varmail: v3

< SETUP WORKLOAD >
Mounting: 192.168.111.155:/export (options: v3)…
removing run directory…done
Unmounting: 192.168.111.155:/export…

< RUN WORKLOAD >
Mounting: 192.168.111.155:/export (options: v3)…
Running command: cd /root/.nfsometer/workload_files/filebench_varmail && filebench -f nfsometer-varmail.f
Unmounting: 192.168.111.155:/export…
Results copied to: nfsometer_trace-filebench_varmail-localhost.localdomain-1433000486.32

> Trace 4/12: 1 of 1 for gitclone: v3

< SETUP WORKLOAD >
Mounting: 192.168.111.155:/export (options: v3)…
removing run directory…done
Unmounting: 192.168.111.155:/export…

< RUN WORKLOAD >
Mounting: 192.168.111.155:/export (options: v3)…
Running command: git clone /root/.nfsometer/workload_files/gitclone/linux-nfs
Unmounting: 192.168.111.155:/export…
Results copied to: nfsometer_trace-gitclone-localhost.localdomain-1433000850.96

> Trace 5/12: 1 of 1 for iozone: v3

< SETUP WORKLOAD >
Mounting: 192.168.111.155:/export (options: v3)…
removing run directory…done
Unmounting: 192.168.111.155:/export…

< RUN WORKLOAD >
Mounting: 192.168.111.155:/export (options: v3)…
Running command: iozone -azcR -f ./testfile
Unmounting: 192.168.111.155:/export…
Results copied to: nfsometer_trace-iozone-localhost.localdomain-1433002099.73

> Trace 6/12: 1 of 1 for dd_100m_1k: v3

< SETUP WORKLOAD >
Mounting: 192.168.111.155:/export (options: v3)…
removing run directory…done
Unmounting: 192.168.111.155:/export…

< RUN WORKLOAD >
Mounting: 192.168.111.155:/export (options: v3)…
Running command: dd if=/dev/zero of=./dd_file.100m_1k bs=1024 count=102400
Unmounting: 192.168.111.155:/export…
Results copied to: nfsometer_trace-dd_100m_1k-localhost.localdomain-1433002100.83

> Trace 7/12: 1 of 1 for filebench_webserver: v3

< SETUP WORKLOAD >
Mounting: 192.168.111.155:/export (options: v3)…
removing run directory…done
Unmounting: 192.168.111.155:/export…

< RUN WORKLOAD >
Mounting: 192.168.111.155:/export (options: v3)…
Running command: cd /root/.nfsometer/workload_files/filebench_webserver && filebench -f nfsometer-webserver.f
Unmounting: 192.168.111.155:/export…
Results copied to: nfsometer_trace-filebench_webserver-localhost.localdomain-1433002406.26

> Trace 8/12: 1 of 1 for python: v3

< SETUP WORKLOAD >
Mounting: 192.168.111.155:/export (options: v3)…
removing run directory…done
Unmounting: 192.168.111.155:/export…

< RUN WORKLOAD >
Mounting: 192.168.111.155:/export (options: v3)…
Running command: tar zxvf /root/.nfsometer/workload_files/python/Python-2.7.2.tgz && cd Python-2.7.2 && ./configure && make
Traceback (most recent call last):
File “/usr/bin/nfsometer”, line 130, in <module>
main()
File “/usr/bin/nfsometer”, line 123, in main
mode_fetch_trace(opts, fetch_only=fetch_only)
File “/usr/bin/nfsometer”, line 77, in mode_fetch_trace
trace.run_traces(collection, opts, fetch_only=fetch_only)
File “/usr/lib/python2.7/site-packages/nfsometerlib/trace.py”, line 846, in run_traces
workload_obj.run()
File “/usr/lib/python2.7/site-packages/nfsometerlib/workloads.py”, line 200, in run
raise e
nfsometerlib.cmd.CmdErrorCode: command “( time ( sh /tmp/nfsometer_trace/command.sh > /tmp/nfsometer_trace/test.log 2>&1 ) ) 2> /tmp/nfsomete                           r_trace/test.time” exited with non-zero status: 1
Unmounting: 192.168.111.155:/export…
WARNING: Moving failed rundir to /tmp/nfsometer_trace-error-1433002440 – it will be deleted on next run of this script!

Step 5 : After running the test I have used the report command to generate the test reports.

[root@localhost nfsometer_results]# nfsometer report
> Using results directory: /root/nfsometer_results

> Generating Basic reports:

client:    localhost.localdomain
server:    192.168.111.155
workload:  dd_100m_100k
kernel:    3.10.0-54.0.1.el7.x86_64
mountopt:  v3
workload:  dd_100m_1k
kernel:    3.10.0-54.0.1.el7.x86_64
mountopt:  v3
workload:  filebench_fileserver
kernel:    3.10.0-54.0.1.el7.x86_64
mountopt:  v3
workload:  filebench_varmail
kernel:    3.10.0-54.0.1.el7.x86_64
mountopt:  v3
workload:  filebench_webserver
kernel:    3.10.0-54.0.1.el7.x86_64
mountopt:  v3
workload:  gitclone
kernel:    3.10.0-54.0.1.el7.x86_64
mountopt:  v3
workload:  iozone
kernel:    3.10.0-54.0.1.el7.x86_64
mountopt:  v3

> Writing reports:

basic_dd_100m_100k.html
basic_dd_100m_1k.html
basic_filebench_fileserver.html
basic_filebench_varmail.html
basic_filebench_webserver.html
basic_gitclone.html
basic_iozone.html
index.html

Graph Summary:
805 images generated

Step 6 : Believe me reporting is the best tool in nfsometer. You can copy the html files created in previous step to your /var/www/html directory and have a look into the graphs generated by the reports.

[root@localhost html]# pwd
/var/www/html
[root@localhost html]# ll
total 1472
-rw-r–r–. 1 root root 168274 May 30 10:49 basic_dd_100m_100k.html
-rw-r–r–. 1 root root 163674 May 30 10:49 basic_dd_100m_1k.html
-rw-r–r–. 1 root root 259157 May 30 10:49 basic_filebench_fileserver.html
-rw-r–r–. 1 root root 216848 May 30 10:49 basic_filebench_varmail.html
-rw-r–r–. 1 root root 210368 May 30 10:49 basic_filebench_webserver.html
-rw-r–r–. 1 root root 262496 May 30 10:49 basic_gitclone.html
-rw-r–r–. 1 root root 199609 May 30 10:49 basic_iozone.html

http://192.168.111.157/basic_dd_100m_100k.html

Step 7 : I have ran the test without any option while leads to testing using all available workloads. If you want to test using only one workload we can do that by specifying with in command.

[root@localhost ~]# nfsometer -n 3 -o v3 192.168.111.155:/export iozone
> Using results directory: /root/nfsometer_results
> Probing 192.168.111.155:/export: v3
Mounting: 192.168.111.155:/export (options: v3)…
Unmounting: 192.168.111.155:/export…

Requested: 1 workloads X 1 options X 3 runs = 3 traces
Results directory already has 1 matching traces
Need to run 2 of 3 requested traces
iozone – needs 2 runs of v3

> Trace 1/2: 1 of 2 for iozone: v3

< SETUP WORKLOAD >
Mounting: 192.168.111.155:/export (options: v3)…
removing run directory…done
Unmounting: 192.168.111.155:/export…

< RUN WORKLOAD >
Mounting: 192.168.111.155:/export (options: v3)…
Running command: iozone -azcR -f ./testfile
Unmounting: 192.168.111.155:/export…
Results copied to: nfsometer_trace-iozone-localhost.localdomain-1433006407.58

> Trace 2/2: 2 of 2 for iozone: v3

< SETUP WORKLOAD >
Mounting: 192.168.111.155:/export (options: v3)…
removing run directory…done
Unmounting: 192.168.111.155:/export…

< RUN WORKLOAD >
Mounting: 192.168.111.155:/export (options: v3)…
Running command: iozone -azcR -f ./testfile

Unmounting: 192.168.111.155:/export…
Results copied to: nfsometer_trace-iozone-localhost.localdomain-1433007599.57
> Successfully ran 2 traces!

> Generating Basic reports:

client:    localhost.localdomain
server:    192.168.111.155
workload:  dd_100m_100k
kernel:    3.10.0-54.0.1.el7.x86_64
mountopt:  v3
workload:  dd_100m_1k
kernel:    3.10.0-54.0.1.el7.x86_64
mountopt:  v3
workload:  filebench_fileserver
kernel:    3.10.0-54.0.1.el7.x86_64
mountopt:  v3
workload:  filebench_varmail
kernel:    3.10.0-54.0.1.el7.x86_64
mountopt:  v3
workload:  filebench_webserver
kernel:    3.10.0-54.0.1.el7.x86_64
mountopt:  v3
workload:  gitclone
kernel:    3.10.0-54.0.1.el7.x86_64
mountopt:  v3
workload:  iozone
kernel:    3.10.0-54.0.1.el7.x86_64
mountopt:  v3

> Writing reports:

basic_dd_100m_100k.html
basic_dd_100m_1k.html
basic_filebench_fileserver.html
basic_filebench_varmail.html
basic_filebench_webserver.html
basic_gitclone.html
basic_iozone.html
index.html

Graph Summary:
106 images generated
699 cached images
106 files pruned

Step 8 : We can list the workloads ran on the server using below command.

[root@localhost ~]# nfsometer list
> Using results directory: /root/nfsometer_results
Result directory ‘/root/nfsometer_results’ contains:

client:    localhost.localdomain
kernel:    3.10.0-54.0.1.el7.x86_64
server:    192.168.111.155
path:      /export
workloads: dd_100m_100k dd_100m_1k filebench_fileserver filebench_varmail filebench_webserver gitclone
1 runs of v3
workloads: iozone
3 runs of v3

Step 9 : If you want to run your customer workloads we can do that as well.

[root@localhost ~]# export NFSOMETER_CMD=”dd if=/dev/zero of=dd.out bs=4096 count=100″
[root@localhost ~]# export NFSOMETER_NAME=”small_work_load”
[root@localhost ~]# export NFSOMETER_DESC=”a small work load “
[root@localhost ~]# nfsometer -o v3 -n 3 192.168.111.155:/export custom
> Using results directory: /root/nfsometer_results
> Probing 192.168.111.155:/export: v3
Mounting: 192.168.111.155:/export (options: v3)…
Unmounting: 192.168.111.155:/export…

Requested: 1 workloads X 1 options X 3 runs = 3 traces
Need to run 3 of 3 requested traces
small_work_load – needs 3 runs of v3

> Trace 1/3: 1 of 3 for small_work_load: v3

< SETUP WORKLOAD >
Mounting: 192.168.111.155:/export (options: v3)…
removing run directory…done
Unmounting: 192.168.111.155:/export…

< RUN WORKLOAD >
Mounting: 192.168.111.155:/export (options: v3)…
Running command: dd if=/dev/zero of=dd.out bs=4096 count=100
Unmounting: 192.168.111.155:/export…
Results copied to: nfsometer_trace-small_work_load-localhost.localdomain-1433007854.64

> Trace 2/3: 2 of 3 for small_work_load: v3

< SETUP WORKLOAD >
Mounting: 192.168.111.155:/export (options: v3)…
removing run directory…done
Unmounting: 192.168.111.155:/export…

< RUN WORKLOAD >
Mounting: 192.168.111.155:/export (options: v3)…
Running command: dd if=/dev/zero of=dd.out bs=4096 count=100
Unmounting: 192.168.111.155:/export…
Results copied to: nfsometer_trace-small_work_load-localhost.localdomain-1433007854.94

> Trace 3/3: 3 of 3 for small_work_load: v3

< SETUP WORKLOAD >
Mounting: 192.168.111.155:/export (options: v3)…
removing run directory…done
Unmounting: 192.168.111.155:/export…

< RUN WORKLOAD >
Mounting: 192.168.111.155:/export (options: v3)…
Running command: dd if=/dev/zero of=dd.out bs=4096 count=100
Unmounting: 192.168.111.155:/export…
Results copied to: nfsometer_trace-small_work_load-localhost.localdomain-1433007855.23
> Successfully ran 3 traces!

> Generating Basic reports:

client:    localhost.localdomain
server:    192.168.111.155
workload:  dd_100m_100k
kernel:    3.10.0-54.0.1.el7.x86_64
mountopt:  v3
workload:  dd_100m_1k
kernel:    3.10.0-54.0.1.el7.x86_64
mountopt:  v3
workload:  filebench_fileserver
kernel:    3.10.0-54.0.1.el7.x86_64
mountopt:  v3
workload:  filebench_varmail
kernel:    3.10.0-54.0.1.el7.x86_64
mountopt:  v3
workload:  filebench_webserver
kernel:    3.10.0-54.0.1.el7.x86_64
mountopt:  v3
workload:  gitclone
kernel:    3.10.0-54.0.1.el7.x86_64
mountopt:  v3
workload:  iozone
kernel:    3.10.0-54.0.1.el7.x86_64
mountopt:  v3
workload:  small_work_load
kernel:    3.10.0-54.0.1.el7.x86_64
mountopt:  v3

> Writing reports:

basic_dd_100m_100k.html
basic_dd_100m_1k.html
basic_filebench_fileserver.html
basic_filebench_varmail.html
basic_filebench_webserver.html
basic_gitclone.html
basic_iozone.html
basic_small_work_load.html
index.html

Graph Summary:
96 images generated
805 cached images

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