Nfs – Getting ZFS per dataset IO statistics (or NFS per export IO statistics)

nfsopenindianaopensolarissolariszfs

Where do I find statistics about how IO is divided between zfs datasets? (zpool iostat only tells me how much IO a pool is experiencing.)

All the relevant datasets are used through NFS, so I'd be happy with per export NFS IO statistics also.

We're currently running OpenIndiana

[edit]

It seems that operation and byte counter are available in kstat

kstat -p unix:*:vopstats_???????
...
unix:0:vopstats_2d90002:nputpage        50
unix:0:vopstats_2d90002:nread   12390785
...
unix:0:vopstats_2d90002:read_bytes      22272845340
unix:0:vopstats_2d90002:readdir_bytes   477996168
...

…but the strange hexadecimal ID numbers have to be resolved from /etc/mnttab (better ideas?)

rpool/export/home/jkj /export/home/jkj zfs rw,...,dev=2d90002 1308471917

Now writing a munin plugin to use the data…

Best Answer

How about this... In this instance I have a ZFS filesystem '/volumes/lab3_pool_a/data02/alpha/' and I am using fsstat to get some basic statistics about it. Notice, I am getting stats for both, ZFS as a whole, and this one filesystem. By the way, fsstat has some good options and may give you just what you need.

# fsstat zfs /volumes/lab3_pool_a/data02/alpha/ 1

 new  name   name  attr  attr lookup rddir  read read  write write
 file remov  chng   get   set    ops   ops   ops bytes   ops bytes
    0     0     0    27     0     27     0     0     0     1   208 zfs
    0     0     0     0     0      0     0     0     0     0     0 /volumes/lab3_pool_a/data02/alpha