update header to reflect redistributable status
[unix-history] / usr / src / usr.bin / systat / systat.1
CommitLineData
b5dc1377
CL
1.\" Copyright (c) 1985, 1990 The Regents of the University of California.
2.\" All rights reserved.
6be9699a 3.\"
1802d238 4.\" %sccs.include.redist.roff%
6be9699a 5.\"
1802d238 6.\" @(#)systat.1 6.11 (Berkeley) %G%
b5dc1377
CL
7.\"
8.Dd
9.Dt SYSTAT 1
10.Os BSD 4.3
11.Sh NAME
12.Nm systat
13.Nd display system statistics on a crt
14.Sh SYNOPSIS
15.Nm systat
16.Op Fl display
17.Op Ar refresh-interval
18.Sh DESCRIPTION
19.Nm Systat
6be9699a 20displays various system statistics in a screen oriented fashion
b5dc1377 21using the curses screen display library,
5325ced3 22.Xr curses 3 .
b5dc1377 23.Pp
6be9699a 24While
b5dc1377 25.Nm systat
6be9699a
KM
26is running the screen is usually divided into two windows (an exception
27is the vmstat display which uses the entire screen). The
28upper window depicts the current system load average. The
29information displayed in the lower window may vary, depending on
30user commands. The last line on the screen is reserved for user
31input and error messages.
b5dc1377 32.Pp
6be9699a 33By default
b5dc1377 34.Nm systat
6be9699a 35displays the processes getting the largest percentage of the processor
1802d238
CL
36in the lower window. Other displays show swap space usage, disk
37.Tn I/O
6be9699a 38statistics (a la
b5dc1377 39.Xr iostat 1 ) ,
6be9699a 40virtual memory statistics (a la
b5dc1377 41.Xr vmstat 1 ) ,
6be9699a 42network ``mbuf'' utilization, and network connections (a la
b5dc1377
CL
43.Xr netstat 1 ) .
44.Pp
45Input is interpreted at two different levels.
6be9699a
KM
46A ``global'' command interpreter processes all keyboard input.
47If this command interpreter fails to recognize a command, the
48input line is passed to a per-display command interpreter. This
49allows each display to have certain display-specific commands.
b5dc1377
CL
50.Pp
51Command line options:
1802d238
CL
52.Bl -tag -width "refresh_interval"
53.It Fl Ns Ar display
b5dc1377
CL
54The
55.Fl
56flag expects
57.Ar display
58to be one of:
59.Ic pigs ,
60.Ic iostat ,
61.Ic swap ,
62.Ic mbufs ,
63.Ic vmstat
64or
65.Ic netstat .
66These displays can also be requested interactively (without the
67.Dq Fl )
68and are described in
69full detail below.
1802d238 70.It Ar refresh-interval
b5dc1377
CL
71The
72.Ar refresh-value
73specifies the screen refresh time interval in seconds.
1802d238 74.El
b5dc1377
CL
75.Pp
76Certain characters cause immediate action by
77.Nm systat .
6be9699a 78These are
1802d238
CL
79.Bl -tag -width Fl
80.It Ic \&^L
6be9699a 81Refresh the screen.
1802d238 82.It Ic \&^G
6be9699a
KM
83Print the name of the current ``display'' being shown in
84the lower window and the refresh interval.
1802d238 85.It Ic \&^Z
b5dc1377
CL
86Stop
87.Nm systat .
1802d238 88.It Ic \&:
6be9699a
KM
89Move the cursor to the command line and interpret the input
90line typed as a command. While entering a command the
91current character erase, word erase, and line kill characters
92may be used.
1802d238 93.El
b5dc1377 94.Pp
6be9699a
KM
95The following commands are interpreted by the ``global''
96command interpreter.
1802d238
CL
97.Bl -tag -width Fl
98.It Ic help
6be9699a 99Print the names of the available displays on the command line.
1802d238 100.It Ic load
6be9699a
KM
101Print the load average over the past 1, 5, and 15 minutes
102on the command line.
1802d238 103.It Ic stop
6be9699a 104Stop refreshing the screen.
1802d238
CL
105.It Xo
106.Op Ic start
b5dc1377 107.Op Ar number
1802d238 108.Xc
6be9699a
KM
109Start (continue) refreshing the screen. If a second, numeric,
110argument is provided it is interpreted as a refresh interval
111(in seconds).
112Supplying only a number will set the refresh interval to this
113value.
1802d238 114.It Ic quit
b5dc1377
CL
115Exit
116.Nm systat .
6be9699a 117(This may be abbreviated to
b5dc1377 118.Ic q . )
1802d238 119.El
b5dc1377 120.Pp
6be9699a 121The available displays are:
1802d238
CL
122.Bl -tag -width Ic
123.It Ic pigs
6be9699a
KM
124Display, in the lower window, those processes resident in main
125memory and getting the
b5dc1377 126largest portion of the processor (the default display).
6be9699a
KM
127When less than 100% of the
128processor is scheduled to user processes, the remaining time
129is accounted to the ``idle'' process.
1802d238 130.It Ic iostat
6be9699a
KM
131Display, in the lower window, statistics about processor use
132and disk throughput. Statistics on processor use appear as
133bar graphs of the amount of time executing in user mode (``user''),
b5dc1377 134in user mode running low priority processes (``nice''), in
6be9699a
KM
135system mode (``system''), and idle (``idle''). Statistics
136on disk throughput show, for each drive, kilobytes of data transferred,
fdc57b8c 137number of disk transactions performed, and average seek time
6be9699a
KM
138(in milliseconds). This information may be displayed as
139bar graphs or as rows of numbers which scroll downward. Bar
1802d238 140graphs are shown by default;
b5dc1377
CL
141.Pp
142The following commands are specific to the
143.Ic iostat
144display; the minimum unambiguous prefix may be supplied.
1802d238
CL
145.Pp
146.Bl -tag -width Fl -compact
147.It Cm numbers
148Show the disk
149.Tn I/O statistics in numeric form. Values are
b5dc1377 150displayed in numeric columns which scroll downward.
1802d238
CL
151.It Cm bars
152Show the disk
153.Tn I/O
154statistics in bar graph form (default).
155.It Cm msps
b5dc1377
CL
156Toggle the display of average seek time (the default is to
157not display seek times).
1802d238
CL
158.El
159.It Ic swap
6be9699a
KM
160Display, in the lower window, swap space in use on each swap
161device configured. Two sets of bar graphs are shown. The
162upper graph displays swap space allocated to pure text segments
163(code), the lower graph displays space allocated to stack and
164data segments. Allocated space is sorted by its size into buckets
165of size dmmin, dmmin*2, dmmin*4, up to dmmax (to reflect allocation
166policies imposed by the system). The disk segment size, in sectors,
167is displayed along the left hand side of the text,
168and data and stack graphs.
169Space allocated to the user structure and page
170tables is not currently accounted for.
1802d238 171.It Ic mbufs
6be9699a
KM
172Display, in the lower window, the number of mbufs allocated
173for particular uses, i.e. data, socket structures, etc.
1802d238 174.It Ic vmstat
6be9699a
KM
175Take over the entire display and show a (rather crowded) compendium
176of statistics related to virtual memory usage, process scheduling,
1802d238
CL
177device interrupts, system name translation cacheing, disk
178.Tn I/O
179etc.
b5dc1377 180.Pp
ab3c309d
KM
181The upper left quadrant of the screen shows the number
182of users logged in and the load average over the last one, five,
fdc57b8c 183and fifteen minute intervals.
ab3c309d
KM
184Below this line are statistics on memory utilization.
185The first row of the table reports memory usage only among
b5dc1377 186active processes, that is processes that have run in the previous
ab3c309d
KM
187twenty seconds.
188The second row reports on memory usage of all processes.
189The first column reports on the number of physical pages
190claimed by processes.
191The second column reports the number of physical pages that
192are devoted to read only text pages.
193The third and fourth columns report the same two figures for
194virtual pages, that is the number of pages that would be
195needed if all processes had all of their pages.
196Finally the last column shows the number of physical pages
197on the free list.
b5dc1377 198.Pp
ab3c309d
KM
199Below the memory display is the disk usage display.
200It reports the number of seeks, transfers, and number
201of kilobyte blocks transferred per second averaged over the
202refresh period of the display (by default, five seconds).
fdc57b8c 203For some disks it also reports the average milliseconds per seek.
ab3c309d 204Note that the system only keeps statistics on at most four disks.
b5dc1377 205.Pp
ab3c309d
KM
206Below the disk display is a list of the
207average number of processes (over the last refresh interval)
fdc57b8c 208that are runnable (`r'), in page wait (`p'),
ab3c309d
KM
209in disk wait other than paging (`d'),
210sleeping (`s'), and swapped out but desiring to run (`w').
211Below the queue length listing is a numerical listing and
212a bar graph showing the amount of
213system (shown as `='), user (shown as `>'),
214nice (shown as `-'), and idle time (shown as ` ').
b5dc1377 215.Pp
ab3c309d 216At the bottom left are statistics on name translations.
fdc57b8c 217It lists the number of names translated in the previous interval,
ab3c309d
KM
218the number and percentage of the translations that were
219handled by the system wide name translation cache, and
220the number and percentage of the translations that were
221handled by the per process name translation cache.
b5dc1377 222.Pp
ab3c309d
KM
223Under the date in the upper right hand quadrant are statistics
224on paging and swapping activity.
225The first two columns report the average number of pages
226brought in and out per second over the last refresh interval
227due to page faults and the paging daemon.
228The third and fourth columns report the average number of pages
229brought in and out per second over the last refresh interval
230due to swap requests initiated by the scheduler.
231The first row of the display shows the average
232number of disk transfers per second over the last refresh interval;
233the second row of the display shows the average
234number of pages transferred per second over the last refresh interval.
b5dc1377 235.Pp
ab3c309d
KM
236Below the paging statistics is a line listing the average number of
237total reclaims ('Rec'),
238intransit blocking page faults (`It'),
239swap text pages found in free list (`F/S'),
240file system text pages found in free list (`F/F'),
1802d238
CL
241reclaims from free list
242.Pp Sq RFL ,
ab3c309d 243pages freed by the clock daemon (`Fre'),
b5dc1377 244and sequential process pages freed (`SFr')
ab3c309d 245per second over the refresh interval.
b5dc1377 246.Pp
ab3c309d
KM
247Below this line are statistics on the average number of
248zero filled pages (`zf') and demand filled text pages (`xf')
249per second over the refresh period.
250The first row indicates the number of requests that were
251resolved, the second row shows the number that were set up,
252and the last row shows the percentage of setup requests were
253actually used.
254Note that this percentage is usually less than 100%,
255however it may exceed 100% if a large number of requests
256are actually used long after they were set up during a
b5dc1377 257period when no new pages are being set up.
ab3c309d
KM
258Thus this figure is most interesting when observed over
259a long time period, such as from boot time
260(see below on getting such a display).
b5dc1377 261.Pp
ab3c309d
KM
262Below the page fill statistics is a column that
263lists the average number of context switches (`Csw'),
aababfd1 264traps (`Trp'; includes page faults), system calls (`Sys'), interrupts (`Int'),
1802d238
CL
265characters output to DZ ports using
266.No pseudo Ns -DMA
267(`Pdm'),
aababfd1 268network software interrupts (`Sof'),
ab3c309d
KM
269page faults (`Flt'), pages scanned by the page daemon (`Scn'),
270and revolutions of the page daemon's hand (`Rev')
271per second over the refresh interval.
b5dc1377 272.Pp
ab3c309d
KM
273Running down the right hand side of the display is a breakdown
274of the interrupts being handled by the system.
275At the top of the list is the total interrupts per second
276over the time interval.
277The rest of the column breaks down the total on a device
b5dc1377 278by device basis.
ab3c309d 279Only devices that have interrupted at least once since boot time are shown.
b5dc1377 280.Pp
6be9699a 281The following commands are specific to the
b5dc1377 282.Ic vmstat
6be9699a 283display; the minimum unambiguous prefix may be supplied.
1802d238
CL
284.Pp
285.Bl -tag -width Ar -compact
286.It Cm boot
fdc57b8c 287Display cumulative statistics since the system was booted.
1802d238 288.It Cm run
6be9699a
KM
289Display statistics as a running total from the point this
290command is given.
1802d238 291.It Cm time
6be9699a 292Display statistics averaged over the refresh interval (the default).
1802d238 293.It Cm zero
6be9699a 294Reset running statistics to zero.
1802d238
CL
295.El
296.It Ic netstat
b5dc1377
CL
297Display, in the lower window, network connections. By default,
298network servers awaiting requests are not displayed. Each address
299is displayed in the format ``host.port'', with each shown symbolically,
300when possible. It is possible to have addresses displayed numerically,
301limit the display to a set of ports, hosts, and/or protocols
302(the minimum unambiguous prefix may be supplied):
303.Pp
1802d238
CL
304.Bl -tag -width Ar -compact
305.It Cm all
6be9699a 306Toggle the displaying of server processes awaiting requests (this
b5dc1377
CL
307is the equivalent of the
308.Fl a
6be9699a 309flag to
b5dc1377 310.Ar netstat 1 ) .
1802d238 311.It Cm numbers
6be9699a 312Display network addresses numerically.
1802d238 313.It Cm names
6be9699a 314Display network addresses symbolically.
1802d238 315.It Ar protocol
ecaa0bb9
SL
316Display only network connections using the indicated protocol
317(currently either ``tcp'' or ``udp'').
1802d238 318.It Cm ignore Op Ar items
ecaa0bb9
SL
319Do not display information about connections associated with
320the specified hosts or ports. Hosts and ports may be specified
321by name (``ucbmonet'', ``ftp''), or numerically. Host addresses
322use the Internet dot notation (``128.32.0.9''). Multiple items
323may be specified with a single command by separating them with
324spaces.
1802d238 325.It Cm display Op Ar items
ecaa0bb9 326Display information about the connections associated with the
b5dc1377
CL
327specified hosts or ports. As for
328.Ar ignore ,
329.Op Ar items
fdc57b8c 330may be names or numbers.
1802d238 331.It Cm show Op Ar ports\&|hosts
ecaa0bb9
SL
332Show, on the command line, the currently selected protocols,
333hosts, and ports. Hosts and ports which are being ignored
334are prefixed with a `!'. If
b5dc1377 335.Ar ports
ecaa0bb9 336or
b5dc1377
CL
337.Ar hosts
338is supplied as an argument to
339.Cm show ,
fdc57b8c 340then only the requested information will be displayed.
1802d238 341.It Cm reset
6be9699a
KM
342Reset the port, host, and protocol matching mechanisms to the default
343(any protocol, port, or host).
1802d238
CL
344.El
345.El
b5dc1377
CL
346.Pp
347Commands to switch between displays may be abbreviated to the
348minimum unambiguous prefix; for example, ``io'' for ``iostat''.
349Certain information may be discarded when the screen size is
350insufficient for display. For example, on a machine with 10
351drives the
352.Ic iostat
353bar graph displays only 3 drives on a 24 line terminal. When
354a bar graph would overflow the allotted screen space it is
355truncated and the actual value is printed ``over top'' of the bar.
356.Pp
357The following commands are common to each display which shows
358information about disk drives. These commands are used to
359select a set of drives to report on, should your system have
360more drives configured than can normally be displayed on the
361screen.
1802d238
CL
362.Pp
363.Bl -tag -width Tx -compact
364.It Cm ignore Op Ar drives
b5dc1377
CL
365Do not display information about the drives indicated. Multiple
366drives may be specified, separated by spaces.
1802d238 367.It Cm display Op Ar drives
b5dc1377
CL
368Display information about the drives indicated. Multiple drives
369may be specified, separated by spaces.
1802d238 370.El
b5dc1377 371.Sh FILES
1802d238
CL
372.Bl -tag -width /etc/networks -compact
373.It Pa /vmunix
374For the namelist.
375.It Pa /dev/kmem
376For information in main memory.
377.It Pa /dev/drum
378For information about swapped out processes.
379.It Pa /etc/hosts
380For host names.
381.It Pa /etc/networks
382For network names.
383.It Pa /etc/services
384For port names.
385.El
b5dc1377 386.Sh HISTORY
1802d238
CL
387The
388.Nm systat
389program appeared in
390.Bx 4.3 .
b5dc1377 391.Sh BUGS
6be9699a
KM
392Takes 2-10 percent of the cpu. Certain displays presume
393a 24 line by 80 character terminal. The swap space display
394should account for space allocated to the user structure and
fdc57b8c 395page tables. The
b5dc1377 396.Ic vmstat
6be9699a 397display looks out of place because it is (it was added in as
fdc57b8c 398a separate display rather than create a new program).
b5dc1377 399.Pp
6be9699a 400The whole
fdc57b8c 401thing is pretty hokey and was included in the distribution under
6be9699a 402serious duress.