Meet the Stats - today: fsstat
There are a lot of *stat
in Solaris … prstat
, vmstat
, iostat
, vmstat
. In the next weeks i want to write intermittently about all the stats. One of the lesser known members of the stat family will make the start: It’s fsstat
. This small tool gives you an deep insight into the inner workings of your filesystem. It can show you what operations are really done in what frequency. So don’t have to rely on assumptions about it.
fsstat
is quite new, it’s in Solaris 10 since 10/06 and in Opensolaris since Build 36. It uses some new kstat
counters to deliver the numbers.
Using fsstat
When you invoke fsstat
you get some general overview about the filesystem activity. Some operations are grouped into more general classes to summarize the information:
As you may have already noticed, you can specify the frequency and the number of printing those information similar to other *stat
tools. fsstat /export/home/jmoekamp/ 10 10
would print this information 10 times every 10 seconds. Leaving out the third parameter will give you this information every 10 seconds until you interrupt this tool. Additionally it’s important to know that the first line of output of thi tool gives you the aggregated information since the mounting of this filesystem.
It’s perfectly possible to to dig down into this groups. -a
gives you detailed information about the frequency of operations relating to filesystem operations:
-v
helps you to learn more about the virtual memory operations on a file system:
The -i
is of more general interest, as it gives you some insight into the read/write load on your filesystem:
Using fsstat
with the -n
option prints detailed information about all operations that relate to the names:
Of course there is an option giving you all information at once.
Additionally you are able to get those data per type of filesystem:
Possible usecases
It’s just a very simple usecase: I’ve used fsstat once to find a user loading the disk subsystem. All users had their own filesystem due to ZFS. So the easiest way to find the problematic user was just to print out the statistics for all user home directories.
When used with the *
it prints out stats for all the filesystems that have their mountpoint in this directory. So it was easy to find the filesystem and thus the user with the highest load.
Do you want to learn more?
manpages
fsstat(1M) - report file system statistics