# Is there any way to monitor IO status on zfs volumes individually?



## belon_cfy (May 31, 2012)

Hi,

Is there any command like fsstat on Solaris for zfs volume IO monitoring? I have followed the http://forums.freebsd.org/showthread.php?t=9909 for installing fsstat but seems it is not the same thing.

*zpool iostat* only shows me the aggregate IO on zpool, it doesn't show individual IO about the volumes created on that pool. 

*statfs* shows 'command not found' on FreeBSD 9. Any other tools?


----------



## t1066 (May 31, 2012)

Have you tried

`$ zpool iostat -v`

The resulting output looks like


```
$ zpool iostat -v
               capacity     operations    bandwidth
pool        alloc   free   read  write   read  write
----------  -----  -----  -----  -----  -----  -----
myzfs       1.15T  4.29T     24      4  2.43M  53.1K
  raidz2    1.15T  4.29T     24      4  2.43M  53.0K
    gpt/akjc      -      -     14      1   580K  17.4K
    gpt/0773      -      -     11      1   585K  17.8K
    gpt/6062      -      -     10      1   589K  17.7K
    gpt/2651      -      -      8      1   587K  17.4K
    gpt/gvkc      -      -     14      1   596K  17.8K
    gpt/ja7h      -      -     14      1   593K  17.7K
logs            -      -      -      -      -      -
  gpt/log1   260K  9.94G      0      0      2    174
cache           -      -      -      -      -      -
  gpt/cache0  29.6G  74.4G     12      0  1.52M  73.3K
  gpt/cache1  29.4G  79.6G     12      0  1.50M  72.9K
```


----------



## belon_cfy (May 31, 2012)

t1066 said:
			
		

> Have you tried
> 
> `$ zpool iostat -v`
> 
> ...



Yes I did, but it only shows the IO on zpool instead of individual volume. I would like to see the IO usage on the volumes listed at *zfs list*.


----------



## serverhamster (May 31, 2012)

Are you looking for gstat(8)()


----------



## t1066 (May 31, 2012)

How about

`$ iostat /dev/zvol/mypool/myvolume`


----------



## belon_cfy (Jun 1, 2012)

serverhamster said:
			
		

> Are you looking for gstat(8)()



Nope, the gstat only shows the disk I/O, not the I/O of the zfs volume.


----------



## belon_cfy (Jun 1, 2012)

t1066 said:
			
		

> How about
> 
> `$ iostat /dev/zvol/mypool/myvolume`



Not exactly, because it only shows the zvol, not the vol on zfs list 

I'm looking for the command with the similar output in FreeBSD

```
# fsstat  /volumes/vol03 1
 new  name   name  attr  attr lookup rddir  read read  write write
 file remov  chng   get   set    ops   ops   ops bytes   ops bytes
2.74M 2.08M 2.68K  274M   755  1.37G  676K  173M  709G 43.9M 31.2G /
    0     0     0     0     0      0     0     0     0     1   244 /
    0     0     0     0     0      2     0     0     0     1   116 /
    0     0     0   116     0    235     0    16 2.20K     5 2.77K /
    5     1     0 1.85K     0  4.21K    32   524 2.52M    56 7.06K /
    4     0     0   599     0  1.13K     4   126  706K    10   914 /
    1     0     0    21     0     43     0     5    32     4   698 /
    2     0     0    31     0     83     0    65 15.7K    27 15.7K /
    0     0     0     0     0      9     0    12   938     7 1.03K /
    2     1     0   191     0    404     0    24 1.59K     4   462 /
```


----------



## t1066 (Jun 1, 2012)

You should take your question to the fs mailing list. But first let us make sure our terminologies match. *zfs list* would either show a ZFS volume or a ZFS filesystem. When you mention 'vol' which one do you actually mean, or something else?

PS. You could do a *man statfs* to see that it is a system call in the standard C library.


----------



## belon_cfy (Jun 4, 2012)

Hi,

I'm referring to the ZFS filesystem. 

By the way, I got a error message 
	
	



```
Command not found
```
 when typing *statfs*.


----------



## t1066 (Jun 5, 2012)

belon_cfy said:
			
		

> By the way, I got a error message
> 
> 
> 
> ...



Because statfs is not a command. It is a syscall in the standard C library. When you write your own C program, you could use it instead of recoding the same function again.


----------



## belon_cfy (Jun 26, 2012)

Still can't find any command like the example below:http://www.unix.com/man-page/OpenSolaris/1m/fsstat/


----------



## t1066 (Jun 27, 2012)

If you don't mind using DTrace, you could try the following script.


----------

