xref: /freebsd/usr.sbin/iostat/iostat.8 (revision 6adf353a56a161443406b44a45d00c688ca7b857)
1.\"
2.\" Copyright (c) 1997 Kenneth D. Merry.
3.\" All rights reserved.
4.\"
5.\" Redistribution and use in source and binary forms, with or without
6.\" modification, are permitted provided that the following conditions
7.\" are met:
8.\" 1. Redistributions of source code must retain the above copyright
9.\"    notice, this list of conditions and the following disclaimer.
10.\" 2. Redistributions in binary form must reproduce the above copyright
11.\"    notice, this list of conditions and the following disclaimer in the
12.\"    documentation and/or other materials provided with the distribution.
13.\" 3. The name of the author may not be used to endorse or promote products
14.\"    derived from this software without specific prior written permission.
15.\"
16.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
17.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
18.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
19.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
20.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
21.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
22.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
23.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
24.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
25.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
26.\" SUCH DAMAGE.
27.\"
28.\" $FreeBSD$
29.\"
30.\" Copyright (c) 1985, 1991, 1993
31.\"	The Regents of the University of California.  All rights reserved.
32.\"
33.\" Redistribution and use in source and binary forms, with or without
34.\" modification, are permitted provided that the following conditions
35.\" are met:
36.\" 1. Redistributions of source code must retain the above copyright
37.\"    notice, this list of conditions and the following disclaimer.
38.\" 2. Redistributions in binary form must reproduce the above copyright
39.\"    notice, this list of conditions and the following disclaimer in the
40.\"    documentation and/or other materials provided with the distribution.
41.\" 3. All advertising materials mentioning features or use of this software
42.\"    must display the following acknowledgement:
43.\"	This product includes software developed by the University of
44.\"	California, Berkeley and its contributors.
45.\" 4. Neither the name of the University nor the names of its contributors
46.\"    may be used to endorse or promote products derived from this software
47.\"    without specific prior written permission.
48.\"
49.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
50.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
51.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
52.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
53.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
54.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
55.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
56.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
57.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
58.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
59.\" SUCH DAMAGE.
60.\"
61.\"	@(#)iostat.8	8.1 (Berkeley) 6/6/93
62.\"
63.Dd December 22, 1997
64.Dt IOSTAT 8
65.Os
66.Sh NAME
67.Nm iostat
68.Nd report
69.Tn I/O
70statistics
71.Sh SYNOPSIS
72.Nm
73.Op Fl CdhKIoT?\&
74.Op Fl c Ar count
75.Op Fl M Ar core
76.Op Fl n Ar devs
77.Op Fl N Ar system
78.Oo
79.Fl t
80.Sm off
81.Ar type , if , pass
82.Sm on
83.Oc
84.Op Fl w Ar wait
85.Op Ar drives
86.Sh DESCRIPTION
87.Nm Iostat
88displays kernel
89.Tn I/O
90statistics on terminal, device and cpu operations.
91The first statistics that are printed are averaged over the system uptime.
92To get information about the current activity, a suitable wait time should
93be specified, so that the subsequent sets of printed statistics will be
94averaged over that time.
95.Pp
96.Pp
97The options are as follows:
98.Bl -tag -width flag
99.It Fl c
100Repeat the display
101.Ar count
102times.
103If no
104.Ar wait
105interval is specified, the default is 1 second.
106.It Fl C
107Display CPU statistics.
108This is on by default, unless
109.Fl d
110is specified.
111.It Fl d
112Display only device statistics.
113If this flag is turned on, only device statistics will be displayed, unless
114.Fl C
115or
116.Fl T
117is also specfied to enable the display of CPU or TTY statistics.
118.It Fl h
119Put iostat in
120.Sq top
121mode.
122In this mode, iostat will show devices in order from highest to lowest bytes
123per measurement cycle.
124.It Fl I
125Display total statstics for a given time period, rather than average
126statistics for each second during that time period.
127.It Fl K
128In the blocks transfered display (-o), display block count in kilobytes rather
129then the device native block size.
130.It Fl M
131Extract values associated with the name list from the specified core
132instead of the default
133.Dq Pa /dev/kmem .
134.It Fl n
135Display up to
136.Ar devs
137number of devices.
138.Nm
139will display fewer devices if there aren't
140.Ar devs
141devices present.
142.It Fl N
143Extract the name list from the specified system instead of the default
144.Dq Pa /kernel .
145.It Fl o
146Display old-style
147.Nm
148device statistics.
149Sectors per second, transfers per second, and miliseconds per seek are
150displayed.
151If
152.Fl I
153is specified, total blocks/sectors, total transfers, and
154miliseconds per seek are displayed.
155.It Fl t
156Specify which types of devices to display.
157There are three different categories of devices:
158.Pp
159.Bl -tag -width indent -compact
160.It device type:
161.Bl -tag -width 9n -compact
162.It da
163Direct Access devices
164.It sa
165Sequential Access devices
166.It printer
167Printers
168.It proc
169Processor devices
170.It worm
171Write Once Read Multiple devices
172.It cd
173CD devices
174.It scanner
175Scanner devices
176.It optical
177Optical Memory devices
178.It changer
179Medium Changer devices
180.It comm
181Communication devices
182.It array
183Storage Array devices
184.It enclosure
185Enclosure Services devices
186.It floppy
187Floppy devices
188.El
189.Pp
190.It interface:
191.Bl -tag -width 9n -compact
192.It IDE
193Integrated Drive Electronics devices
194.It SCSI
195Small Computer System Interface devices
196.It other
197Any other device interface
198.El
199.Pp
200.It passthrough:
201.Bl -tag -width 9n -compact
202.It pass
203Passthrough devices
204.El
205.El
206.Pp
207The user must specify at least one device type, and may specify at most
208one device type from each category.
209Multiple device types in a single device type statement must be separated by
210commas.
211.Pp
212Any number of
213.Fl t
214arguments may be specified on the command line.
215All
216.Fl t
217arguments are ORed together to form a matching expression against which
218all devices in the system are compared.
219Any device that fully matches any
220.Fl t
221argument will be included in the
222.Nm
223output, up to the number of devices that can be displayed in
22480 columns, or the maximum number of devices specified by the user.
225.It Fl T
226Display TTY statistics.
227This is on by default, unless
228.Fl d
229is specified.
230.It Fl w
231Pause
232.Ar wait
233seconds between each display.
234If no repeat
235.Ar count
236is specified, the default is infinity.
237.It Fl ?\&
238Display a usage statement and exit.
239.El
240.Pp
241.Nm Iostat
242displays its information in the following format:
243.Bl -tag -width flag
244.It tty
245.Bl -tag -width indent -compact
246.It tin
247characters read from terminals
248.It tout
249characters written to terminals
250.El
251.It devices
252Device operations.
253The header of the field is the device name and unit number.
254.Nm
255will display as many devices as will fit in a standard 80 column screen, or
256the maximum number of devices in the system, whichever is smaller.
257If
258.Fl n
259is specified on the command line, iostat will display the smaller of the
260requested number of devices, and the maximum number of devices in the system.
261To force
262.Nm
263to display specific drives, their names may be supplied on the command
264line.
265.Nm
266will not display more devices than will fit in an 80 column screen, unless
267the
268.Fl n
269argument is given on the command line to specify a maximum number of
270devices to display.
271If fewer devices are specified on the command line than will fit in an 80
272column screen, iostat will show only the specified devices.
273.Pp
274The standard
275.Nm
276device display shows the following statistics:
277.Pp
278.Bl -tag -width indent -compact
279.It KB/t
280kilobytes per transfer
281.It tps
282transfers per second
283.It MB/s
284megabytes per second
285.El
286.Pp
287The standard
288.Nm
289device display, with the
290.Fl I
291flag specified, shows the following statistics:
292.Pp
293.Bl -tag -width indent -compact
294.It KB/t
295kilobytes per transfer
296.It xfrs
297total number of transfers
298.It MB
299total number of megabytes transferred
300.El
301.Pp
302The old-style
303.Nm
304display (using
305.Fl o )
306shows the following statistics:
307.Pp
308.Bl -tag -width indent -compact
309.It sps
310sectors transferred per second
311.It tps
312transfers per second
313.It msps
314average milliseconds per transaction
315.El
316.Pp
317The old-style
318.Nm
319display, with the
320.Fl I
321flag specified, shows the following statistics:
322.Pp
323.Bl -tag -width indent -compact
324.It blk
325total blocks/sectors transferred
326.It xfr
327total transfers
328.It msps
329average milliseconds per transaction
330.El
331.It cpu
332.Bl -tag -width indent -compact
333.It \&us
334% of cpu time in user mode
335.It \&ni
336% of cpu time in user mode running niced processes
337.It \&sy
338% of cpu time in system mode
339.It \&in
340% of cpu time in interrupt mode
341.It \&id
342% of cpu time in idle mode
343.El
344.El
345.Sh FILES
346.Bl -tag -width /dev/kmem -compact
347.It Pa /kernel
348Default kernel namelist.
349.It Pa /dev/kmem
350Default memory file.
351.El
352.Sh EXAMPLES
353.Dl iostat -w 1 da0 da1 cd0
354.Pp
355Display statistics for the first two Direct Access devices and the first
356CDROM device every second ad infinitum.
357.Pp
358.Dl iostat -c 2
359.Pp
360Display the statistics for the first four devices in the system twice, with
361a one second display interval.
362.Pp
363.Dl iostat -t da -t cd -w 1
364.Pp
365Display statistics for all CDROM and Direct Access devices every second
366ad infinitum.
367.Pp
368.Dl iostat -t da,scsi,pass -t cd,scsi,pass
369.Pp
370Display statistics once for all SCSI passthrough devices that provide access
371to either Direct Access or CDROM devices.
372.Pp
373.Dl iostat -h -n 8 -w 1
374.Pp
375Display up to 8 devices with the most I/O every second ad infinitum.
376.Pp
377.Dl iostat -dh -t da -w 1
378.Pp
379Omit the TTY and CPU displays, show devices in order of performance and
380show only Direct Access devices every second ad infinitum.
381.Pp
382.Dl iostat -Iw 3
383.Pp
384Display total statistics every three seconds ad infinitum.
385.Pp
386.Dl iostat -odICTw 2 -c 9
387.Pp
388Display total statistics using the old-style output format 9 times, with
389a two second interval between each measurement/display.
390The
391.Fl d
392flag generally disables the TTY and CPU displays, but since the
393.Fl T
394and
395.Fl C
396flags are given, the TTY and CPU displays will be displayed.
397.Sh SEE ALSO
398.Xr fstat 1 ,
399.Xr netstat 1 ,
400.Xr nfsstat 1 ,
401.Xr ps 1 ,
402.Xr systat 1 ,
403.Xr pstat 8 ,
404.Xr vmstat 8
405.Pp
406The sections starting with ``Interpreting system activity'' in
407.%T "Installing and Operating 4.3BSD" .
408.Sh HISTORY
409This version of
410.Nm
411first appeared in
412.Fx 3.0 .
413.Sh BUGS
414The use of
415.Nm
416as a debugging tool for crash dumps is probably limited because there is
417currently no way to get statistics that only cover the time immediately before
418the crash.
419.Sh AUTHORS
420.An Kenneth Merry Aq ken@FreeBSD.org
421