dtrace scripts io counters per NFS mount

755 Views Asked by At

I need to measure performance counters per NFS mount I have on my Nexenta machine (Based on OpenSolaris).

iostat is great, the problem is that it count by devices and not at the NFS level. Is there any way I can do that with a dtrace script?

Counters Im interested in: (CIFS/NFS) avg_latency per Volumes/Folder (CIFS/NFS) read_latency per Volumes/Folder (CIFS/NFS) write_latency per Volumes/Folder (CIFS/NFS) read_ops/s per Volumes/Folder (CIFS/NFS) write_ops/s per Volumes/Folder (CIFS/NFS) read_data/s per Volumes/Folder (CIFS/NFS) write_data/s per Volumes/Folder c pu_util%

Thanks!

1

There are 1 best solutions below

1
On

You may use the following:-

#!/usr/sbin/dtrace  -qs
/* NFSv3 read/write */
nfsv3:::op-read-done
{
    @nfsrb = sum(args[2]->res_u.ok.data.data_len);
}
nfsv3:::op-write-done
{
    @nfswb = sum(args[2]->res_u.ok.count);
}

dtrace:::END
{
     printa(" read bytes : - %@d\n", @nfsrb);
     printa(" write bytes : - %@d\n", @nfswb);
}