Topic review - FreeBSD - Monitor geom disk i/o statistics using gstat/iostat
Author
Message
mandrei99
Post subject: FreeBSD - Monitor geom disk i/o statistics using gstat/iostat | Posted: Mon Mar 03, 2014 9:47 am
Many utilities are out there to measure I/O throughput statistics on disk. FreeBSD has a tool named "gstat". Man gstat:
Quote:
GSTAT(8) FreeBSD System Manager's Manual GSTAT(8)
NAME gstat -- print statistics about GEOM disks
SYNOPSIS gstat [-abcd] [-f filter] [-I interval]
DESCRIPTION The gstat utility can be used to monitor I/O transactions of geom(4) devices.
The options are as follows:
-a Only display providers that are at least 0.1% busy.
-b Batch mode. Collect numbers, print and exit. Default if stdout is not a tty.
-c Enable display of geom(4) consumers too. The default is to show statistics only for geom(4) producers.
-d Enable display of statistics for delete (BIO_DELETE) operations.
-f filter A regular expression that can be used to only show statistics for some devices. Only devices with the names matching filter will be displayed. The format of the regular expression is described in re_format(7).
-I interval Refresh the gstat display every interval microseconds. Adding a suffix of s, ms, or us (the default) indicates that the update interval is specified in seconds, milliseconds, or microseconds, respectively.
EXIT STATUS The gstat utility exits 0 on success, and >0 if an error occurs.
DESCRIPTION The iostat utility displays kernel I/O statistics on terminal, device and cpu operations. The first statistics that are printed are averaged over the system uptime. To get information about the current activity, a suitable wait time should be specified, so that the subsequent sets of printed statistics will be averaged over that time.
The options are as follows:
-c Repeat the display count times. If no repeat count is specified, the default depends on whether -w is specified. With -w the default repeat count is infinity, otherwise it is 1.
-C Display CPU statistics. This is on by default, unless -d or -x is specified.
-d Display only device statistics. If this flag is turned on, only device statistics will be displayed, unless -C or -T is also speci- fied to enable the display of CPU or TTY statistics.
-h Put iostat in `top' mode. In this mode, iostat will show devices in order from highest to lowest bytes per measurement cycle.
-I Display total statistics for a given time period, rather than aver- age statistics for each second during that time period.
-K In the blocks transferred display (-o), display block count in kilobytes rather then the device native block size.
-M Extract values associated with the name list from the specified core instead of the default ``/dev/kmem''.
-n Display up to devs number of devices. The iostat utility will dis- play fewer devices if there are not devs devices present.
-N Extract the name list from the specified system instead of the default ``/boot/kernel/kernel''.
-o Display old-style iostat device statistics. Sectors per second, transfers per second, and milliseconds per seek are displayed. If -I is specified, total blocks/sectors, total transfers, and mil- liseconds per seek are displayed.
"iostat" command to show I/O statistics per disk with 1sec interval:
Many utilities are out there to measure I/O throughput statistics on disk. FreeBSD has a tool named "gstat". Man gstat: [quote]GSTAT(8) FreeBSD System Manager's Manual GSTAT(8)
NAME gstat -- print statistics about GEOM disks
SYNOPSIS gstat [-abcd] [-f filter] [-I interval]
DESCRIPTION The gstat utility can be used to monitor I/O transactions of geom(4) devices.
The options are as follows:
-a Only display providers that are at least 0.1% busy.
-b Batch mode. Collect numbers, print and exit. Default if stdout is not a tty.
-c Enable display of geom(4) consumers too. The default is to show statistics only for geom(4) producers.
-d Enable display of statistics for delete (BIO_DELETE) operations.
-f filter A regular expression that can be used to only show statistics for some devices. Only devices with the names matching filter will be displayed. The format of the regular expression is described in re_format(7).
-I interval Refresh the gstat display every interval microseconds. Adding a suffix of s, ms, or us (the default) indicates that the update interval is specified in seconds, milliseconds, or microseconds, respectively.
EXIT STATUS The gstat utility exits 0 on success, and >0 if an error occurs.
DESCRIPTION The iostat utility displays kernel I/O statistics on terminal, device and cpu operations. The first statistics that are printed are averaged over the system uptime. To get information about the current activity, a suitable wait time should be specified, so that the subsequent sets of printed statistics will be averaged over that time.
The options are as follows:
-c Repeat the display count times. If no repeat count is specified, the default depends on whether -w is specified. With -w the default repeat count is infinity, otherwise it is 1.
-C Display CPU statistics. This is on by default, unless -d or -x is specified.
-d Display only device statistics. If this flag is turned on, only device statistics will be displayed, unless -C or -T is also speci- fied to enable the display of CPU or TTY statistics.
-h Put iostat in `top' mode. In this mode, iostat will show devices in order from highest to lowest bytes per measurement cycle.
-I Display total statistics for a given time period, rather than aver- age statistics for each second during that time period.
-K In the blocks transferred display (-o), display block count in kilobytes rather then the device native block size.
-M Extract values associated with the name list from the specified core instead of the default ``/dev/kmem''.
-n Display up to devs number of devices. The iostat utility will dis- play fewer devices if there are not devs devices present.
-N Extract the name list from the specified system instead of the default ``/boot/kernel/kernel''.
-o Display old-style iostat device statistics. Sectors per second, transfers per second, and milliseconds per seek are displayed. If -I is specified, total blocks/sectors, total transfers, and mil- liseconds per seek are displayed.[/quote]