xref: /openbsd/usr.bin/systat/systat.1 (revision 73471bf0)
1.\"	$OpenBSD: systat.1,v 1.120 2021/06/02 08:32:22 martijn Exp $
2.\"	$NetBSD: systat.1,v 1.6 1996/05/10 23:16:39 thorpej Exp $
3.\"
4.\" Copyright (c) 1985, 1990, 1993
5.\"	The Regents of the University of California.  All rights reserved.
6.\"
7.\" Redistribution and use in source and binary forms, with or without
8.\" modification, are permitted provided that the following conditions
9.\" are met:
10.\" 1. Redistributions of source code must retain the above copyright
11.\"    notice, this list of conditions and the following disclaimer.
12.\" 2. Redistributions in binary form must reproduce the above copyright
13.\"    notice, this list of conditions and the following disclaimer in the
14.\"    documentation and/or other materials provided with the distribution.
15.\" 3. Neither the name of the University nor the names of its contributors
16.\"    may be used to endorse or promote products derived from this software
17.\"    without specific prior written permission.
18.\"
19.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
20.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
21.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
22.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
23.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
24.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
25.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
26.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
27.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
28.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
29.\" SUCH DAMAGE.
30.\"
31.\"	@(#)systat.1	8.2 (Berkeley) 12/30/93
32.\"
33.Dd $Mdocdate: June 2 2021 $
34.Dt SYSTAT 1
35.Os
36.Sh NAME
37.Nm systat
38.Nd display system statistics
39.Sh SYNOPSIS
40.Nm systat
41.Op Fl aBbhiNn
42.Op Fl d Ar count
43.Op Fl s Ar delay
44.Op Fl w Ar width
45.Op Ar view
46.Op Ar delay
47.Sh DESCRIPTION
48.Nm
49displays various system statistics in a screen-oriented fashion
50using the
51.Xr curses 3
52screen display library.
53.Pp
54While
55.Nm
56is running, the screen is divided into different areas.
57The top line displays the current number of users, the
58three system load average figures over the last 1, 5, and
5915 minute intervals, the host name, and the system time.
60The bottom line of the screen is reserved for
61user input and error messages.
62The information displayed in the rest of the screen
63comprises a
64.Em view ,
65and is the main interface for
66displaying different types of system statistics.
67The
68.Ic vmstat
69view is the default.
70.Pp
71Certain information may be discarded when the screen size is
72insufficient for display.
73For example, on a machine with 10 drives the
74.Ic iostat
75bar graph displays only 3 drives on a 24 line terminal.
76.\".Pp
77.\"Input is interpreted at two different levels.
78.\"A
79.\".Dq global
80.\"command interpreter processes all keyboard input.
81.\"If this command interpreter fails to recognize a command, the
82.\"input line is passed to a per-display command interpreter.
83.\"This allows each display to have certain display-specific commands.
84.Pp
85The options are as follows:
86.Bl -tag -width Ds
87.It Fl a
88Display all lines.
89.It Fl B
90Raw, non-interactive mode.
91The default is to exit after two screen updates,
92with statistics only ever displayed once.
93Useful for views such as
94.Ic cpu ,
95where initial calculations are useless.
96.It Fl b
97Raw, non-interactive mode.
98The default is to exit after one screen update,
99with statistics displayed every update.
100.It Fl d Ar count
101Exit after
102.Ar count
103screen updates.
104.It Fl h
105Human readable mode, where applicable.
106.It Fl i
107Interactive mode.
108.It Fl N
109Resolve network addresses to names.
110This is the opposite of the
111.Fl n
112option.
113.It Fl n
114Do not try to reverse map IP addresses.
115This is the default.
116.It Fl s Ar delay
117Specifies the screen refresh time interval in seconds.
118This option is overridden by the final
119.Ar delay
120argument, if given.
121The default interval is 5 seconds.
122.It Fl w Ar width
123Specifies the maximum width of the output in raw, non-interactive mode.
124.It Ar view
125The
126.Ar view
127argument expects to be one of:
128.Ic vmstat ,
129.Ic pigs ,
130.Ic ifstat ,
131.Ic iostat ,
132.Ic sensors ,
133.Ic mbufs ,
134.Ic netstat ,
135.Ic swap ,
136.Ic states ,
137.Ic rules ,
138.Ic queues ,
139.Ic pf ,
140.Ic pool ,
141.Ic pcache ,
142.Ic malloc ,
143.Ic buckets ,
144.Ic nfsclient ,
145.Ic nfsserver ,
146.Ic cpu ,
147or
148.Ic uvm .
149These displays can also be requested interactively and are described in
150full detail below.
151.Ar view
152may be abbreviated to the minimum unambiguous prefix;
153for example,
154.Dq io
155for
156.Dq iostat .
157.It Ar delay
158The
159.Ar delay
160argument specifies the screen refresh time interval in seconds.
161This is provided for backwards compatibility, and overrides any
162interval specified with the
163.Fl s
164flag.
165The default interval is 5 seconds.
166.El
167.Pp
168Certain characters cause immediate action by
169.Nm .
170These are:
171.Bl -tag -width Ds
172.It Ic \&:
173Move the cursor to the command line and interpret the input
174line typed as a command.
175While entering a command the
176current character erase, word erase, and line kill characters
177may be used.
178.It Ic h
179Toggle printing the names of the available views on the command line.
180.It Ic o
181Select the next ordering which sorts the rows according to a
182combination of columns.
183Available orderings depend on the view.
184Not all views support orderings.
185.It Ic p
186Pause
187.Nm .
188.It Ic q
189Quit
190.Nm .
191.It Ic r
192Reverse the selected ordering if supported by the view.
193.It Ic s
194Change the screen refresh interval in seconds.
195.It Ic \&,
196Print numbers with thousand separators, where applicable.
197.It Ic ^A | Aq Ic Home
198Jump to the beginning of the current view.
199.It Ic ^B | Aq Ic right arrow
200Select the previous view.
201.It Ic ^E | Aq Ic End
202Jump to the end of the current view.
203.It Ic ^F | Aq Ic left arrow
204Select the next view.
205.It Ic ^G
206Toggle printing the name of the current
207view being shown and the refresh interval.
208.It Ic ^L
209Refresh the screen.
210.It Ic ^N | Aq Ic down arrow
211Scroll current view down by one line.
212.It Ic ^P | Aq Ic up arrow
213Scroll current view up by one line.
214.It Ic ^V | Aq Ic Page Down
215Scroll current view down by one page.
216.It Ic Alt-V | Aq Ic Page Up
217Scroll current view up by one page.
218.El
219.Pp
220The following commands are interpreted by the
221.Dq global
222command interpreter.
223.Bl -tag -width Ds
224.It Ic help
225Toggle printing the names of the available views on the command line.
226.It Ic human
227Toggle human readable mode, where applicable.
228.It Ic order
229Toggle printing the names of the available orderings on the command line.
230.It Ic quit
231Quit
232.Nm .
233(This may be abbreviated to
234.Ic q . )
235.It Ic stop
236Stop refreshing the screen.
237.It Xo
238.Op Ic start
239.Op Ar number
240.Xc
241Start (continue) refreshing the screen.
242If a second, numeric,
243argument is provided it is interpreted as a refresh interval
244(in seconds).
245Supplying only a number will set the refresh interval to this
246value.
247.El
248.Pp
249.Ar view
250may be abbreviated to the minimum unambiguous prefix.
251The available views are:
252.Bl -tag -width "netstatXXX"
253.It Ic buckets
254Display kernel
255.Xr malloc 9
256bucket statistics similar to the output of
257.Cm vmstat Fl m .
258.It Ic cpu
259Display information about the average usage of each CPU,
260similar to the output provided by
261.Xr top 1 .
262.It Ic ifstat
263Display interface statistics.
264The
265.Dq State
266column has the format
267.Sm off
268.Xo
269.Cm up | dn
270.Bq : Cm U | D .
271.Xc
272.Sm on
273.Sq up
274and
275.Sq dn
276represent whether the interface is up or down.
277.Sq U
278and
279.Sq D
280represent whether the interface is connected or not;
281in the case of
282.Xr carp 4
283interfaces, whether the interface is in master or backup state, respectively.
284.Pp
285The character
286.Ic B
287changes the counter view between bytes and bits.
288Pressing
289.Ic b
290displays statistics as calculated from boot time.
291.Ic r
292changes the counters to show their totals as calculated
293between display refreshes.
294.Ic t
295changes the counters to show the average per second over
296the display refresh interval;
297this is the default.
298.Ic d
299displays input and output queue drops.
300.Ic e
301displays input and output errors.
302.Ic f
303displays input and output queue drops plus errors.
304This is the default view.
305.It Ic iostat
306Display statistics about disk throughput.
307Statistics
308on disk throughput show, for each drive, data transferred in bytes,
309number of disk transactions performed, and time spent in disk accesses
310(in fractions of a second).
311Pressing
312.Ic b
313displays statistics as calculated from boot time.
314.Ic t
315changes the counters to show the average per second over
316the display refresh interval;
317this is the default.
318.It Ic malloc
319Display kernel
320.Xr malloc 9
321type statistics similar to the output of
322.Cm vmstat Fl m .
323Available orderings are:
324.Ic name ,
325.Ic inuse ,
326.Ic memuse ,
327and
328.Ic requests .
329.It Ic mbufs
330Display mbuf usage information from kernel pools
331and mbuf cluster pool statistics of each network interface.
332.It Ic netstat
333Display network connections.
334Each address
335is displayed numerically in the format
336.Dq host:port .
337By default, network servers awaiting requests are not displayed.
338It is also possible to have addresses displayed symbolically,
339when possible, and limit the display to a set of protocols
340(the minimum unambiguous prefix may be supplied):
341.Bl -tag -width Ar
342.It Cm all
343Toggle the displaying of server processes awaiting requests (this
344is the equivalent of the
345.Fl a
346flag to
347.Xr netstat 1 ) .
348.It Cm names
349Display network addresses symbolically.
350.It Cm numbers
351Display network addresses numerically.
352.It Cm reset
353Reset matching mechanisms to the default.
354.\".It Cm show Oo
355.\".Ar protocols | ports | hosts
356.\".Oc
357.\"Show, on the command line, the currently selected protocols,
358.\"hosts, and ports.
359.\"Protocols, hosts and ports which are being ignored are prefixed with a
360.\".Ql \&! .
361.\"If an argument is supplied to
362.\".Cm show ,
363.\"then only the requested information will be displayed.
364.It Cm tcp | udp | other
365Display only network connections using the indicated protocol.
366.El
367.It Ic nfsclient
368Display statistics about NFS client activity.
369Output resembles
370.Cm nfsstat Fl c .
371.It Ic nfsserver
372Display statistics about NFS server activity.
373Output resembles
374.Cm nfsstat Fl s .
375.It Ic pf
376Display filter information about
377.Xr pf 4 ,
378similar to the output of
379.Cm pfctl Fl s Cm info
380option.
381.It Ic pigs
382Display those processes resident in main
383memory and getting the
384largest portion of the processor.
385When less than 100% of the
386processor is scheduled to user processes, the remaining time
387is accounted to the
388.Dq idle
389process.
390.It Ic pool
391Display kernel
392.Xr pool 9
393statistics similar to the output of
394.Cm vmstat Fl m .
395Available orderings are:
396.Ic name ,
397.Ic requests ,
398.Ic size ,
399and
400.Ic number of pages .
401.Pp
402By default only the statistics of active pools are displayed but pressing
403.Ic A
404changes the view to show all of them.
405.It Ic pcache
406Display kernel
407.Xr pool 9
408per CPU cache statistics.
409Ordering is available on all columns.
410.It Ic queues
411Display statistics about the active queues,
412similar to the output of
413.Cm pfctl Fl s Cm queue .
414.It Ic rules
415Display pf rules statistics, similar to the output of
416.Cm pfctl Fl s Cm rules .
417.It Ic sensors
418Display the current values of available hardware sensors,
419in a format similar to that of
420.Xr sysctl 8 .
421.It Ic states
422Display pf states statistics, similar to the output of
423.Cm pfctl Fl s Cm states .
424Available orderings are:
425.Ic none ,
426.Ic bytes ,
427.Ic expiry ,
428.Ic packets ,
429.Ic age ,
430.Ic source address ,
431.Ic source port ,
432.Ic destination address ,
433.Ic destination port ,
434.Ic rate ,
435and
436.Ic peak
437columns.
438.It Ic swap
439Show information about swap space usage on all the
440swap areas compiled into the kernel.
441The first column is the device name of the partition.
442The next column is the total space available in the partition.
443The
444.Ar Used
445column indicates the total blocks used so far;
446the graph shows the percentage of space in use on each partition.
447If there is more than one swap partition in use,
448a total line is also shown.
449Areas known to the kernel but not in use are shown as not available.
450.It Ic vmstat
451Take over the entire display and show a (rather crowded) compendium
452of statistics related to virtual memory usage, process scheduling,
453device interrupts, system name translation caching, disk I/O, etc.
454This view is the default.
455.Pp
456Below the top line are statistics on memory utilization.
457The first row of the table reports memory usage only among
458active processes, that is, processes that have run in the previous
459twenty seconds.
460The second row reports on memory usage of all processes.
461The first column reports on the amount of physical memory
462claimed by processes.
463The second column reports the same figure for
464virtual memory, that is, the amount of memory that would be
465needed if all processes were resident at the same time.
466Finally, the last column shows the amount of physical memory
467on the free list.
468.Pp
469Below the memory display is a list of the average number of processes
470(over the last refresh interval) that are runnable
471.Pq Sq r ,
472in disk wait other than paging
473.Pq Sq d ,
474sleeping
475.Pq Sq s ,
476and swapped out but desiring to run
477.Pq Sq w .
478Below the queue length listing is a numerical listing and
479a bar graph showing the amount of
480interrupt (shown as
481.Ql | ) ,
482spinning (shown as
483.Ql @ ) ,
484system (shown as
485.Ql = ) ,
486user plus nice (shown as
487.Ql > ) ,
488and idle time (shown as
489.Ql \ \& ) .
490.Pp
491To the right of the Proc display are statistics about
492Context switches
493.Pq Dq Csw ,
494Traps
495.Pq Dq Trp ,
496Syscalls
497.Pq Dq Sys ,
498Interrupts
499.Pq Dq Int ,
500Soft interrupts
501.Pq Dq Sof ,
502and Faults
503.Pq Dq Flt
504which have occurred during the last refresh interval.
505.Pp
506Below the CPU usage graph are statistics on name translations.
507It lists the number of names translated in the previous interval,
508the number and percentage of the translations that were
509handled by the system wide name translation cache, and
510the number and percentage of the translations that were
511handled by the per process name translation cache.
512.Pp
513At the bottom left is the disk usage display.
514It reports the number of seeks, transfers, number
515of kilobyte blocks transferred per second averaged over the
516refresh period of the display, and
517the time spent in disk accesses.
518.Pp
519Under the date in the upper right hand quadrant are statistics
520on paging and swapping activity.
521The first two columns report the average number of pages
522brought in and out per second over the last refresh interval
523due to page faults and the paging daemon.
524The third and fourth columns report the average number of pages
525brought in and out per second over the last refresh interval
526due to swap requests initiated by the scheduler.
527The first row of the display shows the average
528number of disk transfers per second over the last refresh interval.
529The second row of the display shows the average
530number of pages transferred per second over the last refresh interval.
531.Pp
532Running down the right hand side of the display is a breakdown
533of the interrupts being handled by the system.
534At the top of the list is the total interrupts per second
535over the time interval.
536The rest of the column breaks down the total on a device
537by device basis.
538Only devices that have interrupted at least once since boot time are shown.
539.Pp
540Below the Interrupts display are
541the average number of input and output packets per second
542for all interfaces over the last refresh interval.
543.Pp
544Below the SWAPPING display and slightly to the left of the Interrupts
545display is a list of virtual memory statistics.
546The abbreviations are:
547.Pp
548.Bl -tag -compact -width "kmapentXX" -offset indent
549.It forks
550process forks
551.It fkppw
552forks where parent waits
553.It fksvm
554forks where vmspace is shared
555.It pwait
556fault had to wait on a page
557.It relck
558fault relock called
559.It rlkok
560fault relock is successful
561.It noram
562faults out of ram
563.It ndcpy
564number of times fault clears "need copy"
565.It fltcp
566number of times fault promotes with copy
567.It zfod
568fault promotes with zerofill
569.It cow
570number of times fault anon cow
571.It fmin
572min number of free pages
573.It ftarg
574target number of free pages
575.It itarg
576target number of inactive pages
577.It wired
578wired pages
579.It pdfre
580pages daemon freed since boot
581.It pdscn
582pages daemon scanned since boot
583.It pzidl
584number of zeroed pages
585.It kmape
586number of kernel map entries
587.El
588.It Ic uvm
589Display statistics relevant to the UVM subsystem.
590The statistics are divided into eight groups.
591.Pp
592.Bl -tag -compact -width "reserve_pagedaemon" -offset indent
593.It Page Counters:
594.It npages
595pages managed by UVM
596.It free
597free pages
598.It active
599active pages
600.It inactive
601freed pages that may be wanted back
602.It paging
603pages in the process of being paged out
604.It wired
605wired pages
606.It zeropages
607zero'd pages
608.It reserve_pagedaemon
609pages reserved for pagedaemon
610.It reserve_kernel
611pages reserved for kernel.
612.It vnodepages
613pages used by vnode page cache
614.It vtextpages
615pages used by vtext vnodes
616.Pp
617.It Stats Counters:
618.It faults
619page fault count
620.It traps
621trap count
622.It intrs
623interrupt count
624.It swtch
625context switch count
626.It softs
627software interrupt count
628.It syscalls
629system calls
630.It pageins
631pagein operation count
632.It pgswapin
633pages swapped in
634.It pgswapout
635pages swapped out
636.It forks
637forks.
638.It forks_ppwait
639forks where parent waits
640.It forks_sharevm
641forks where vmspace is shared
642.It pga_zerohit
643pagealloc found requested zero'd pages
644.It pga_zeromiss
645pagealloc failed to obtain zero'd pages
646.Pp
647.It Fault Counters:
648.It fltnoram
649fault was out of ram
650.It fltnoanon
651fault was out of anons
652.It fltnoamap
653fault was out of amap chunks
654.It fltpgwait
655fault had to wait on a page
656.It fltpgrele
657fault found a released page
658.It fltrelck
659fault relock called
660.It fltrelckok
661fault relock was a success
662.It fltanget
663fault got anon page
664.It fltanretry
665fault retried an anon get
666.It fltamcopy
667fault cleared "needs copy"
668.It fltnamap
669fault mapped a neighbor anon page
670.It fltnomap
671fault mapped a neighbor obj page
672.It fltlget
673fault did a locked pgo_get
674.It fltget
675fault did an unlocked get
676.It flt_anon
677fault anon (case 1a)
678.It flt_acow
679fault anon cow (case 1b)
680.It flt_obj
681fault was on object page (2a)
682.It flt_prcopy
683fault promotes with copy (2b)
684.It flt_przero
685fault promotes with zerofill (2b)
686.Pp
687.It Pageout Params:
688.It freemin
689minimum number of free pages
690.It freetarg
691target number of free pages
692.It inactarg
693target number of inactive pages
694.It wiredmax
695maximum number of wired pages
696.It anonmin
697mininumu threshold for anon pages
698.It vtextmin
699minimum threshold for vtext pages
700.It vnodemin
701minimum threshold for vnode pages
702.It anonminpct
703minimum percent anon pages
704.It vtextminpct
705minimum percent vtext pages
706.It vnodeminpct
707minimum percent vnode pages
708.Pp
709.It Swap Counters:
710.It nswapdev
711configured swap devices
712.It swpages
713PAGE_SIZE'ed swap pages
714.It swpginuse
715swap pages in use
716.It swpgonly
717in use swap pages not in RAM
718.It nswget
719swap pages moved from disk to RAM
720.It nanon
721total anon's
722.Pp
723.It Daemon Counters:
724.It pdwoke
725times daemon woke up
726.It pdrevs
727times daemon rev'd clock hand
728.It pdswout
729times daemon called for swapout
730.It pdfreed
731pages daemon freed since boot
732.It pdscans
733pages daemon scanned since boot
734.It pdanscan
735anonymous pages scanned by daemon
736.It pdobscan
737object pages scanned by daemon
738.It pdreact
739pages daemon reactivated since boot
740.It pdbusy
741times daemon found a busy page
742.It pdpageouts
743times daemon started a pageout
744.It  pdpending
745times daemon got a pending pagout
746.It pddeact
747pages daemon deactivates
748.Pp
749.It Misc Counters:
750.It fpswtch
751FPU context switches
752.It kmapent
753kernel map entries
754.Pp
755.It Constants:
756.It pagesize
757size of a page, always a power of 2
758.It pagemask
759page mask
760.It pageshift
761page shift
762.El
763.El
764.\".Pp
765.\"The following commands are specific to the
766.\".Ic vmstat
767.\"and
768.\".Ic ifstat
769.\"views; the minimum unambiguous prefix may be supplied.
770.\".Pp
771.\".Bl -tag -width Ds -compact
772.\".It Cm boot
773.\"Display cumulative statistics since the system was booted.
774.\".It Cm run
775.\"Display statistics as a running total from the point this
776.\"command is given.
777.\".It Cm time
778.\"Display statistics averaged over the refresh interval (the default).
779.\".It Cm zero
780.\"Reset running statistics to zero.
781.\".El
782.\".Pp
783.\"The following commands are common to each view which shows
784.\"information about disk drives.
785.\"These commands are used to select a set of drives to report on,
786.\"should a system have more drives configured
787.\"than can normally be displayed on the screen.
788.\".Pp
789.\".Bl -tag -width Tx -compact
790.\".It Cm display Op Ar drives
791.\"Display information about the drives indicated.
792.\"Multiple drives may be specified, separated by spaces.
793.\".It Cm ignore Op Ar drives
794.\"Do not display information about the drives indicated.
795.\"Multiple drives may be specified, separated by spaces.
796.\".El
797.Sh FILES
798.Bl -tag -width "/etc/servicesXXX" -compact
799.It Pa /etc/hosts
800Host names.
801.It Pa /etc/pf.conf
802.Xr pf 4
803configuration.
804.It Pa /etc/services
805Port names.
806.El
807.Sh SEE ALSO
808.Xr fstat 1 ,
809.Xr kill 1 ,
810.Xr netstat 1 ,
811.Xr nfsstat 1 ,
812.Xr ps 1 ,
813.Xr top 1 ,
814.Xr iostat 8 ,
815.Xr pfctl 8 ,
816.Xr pstat 8 ,
817.Xr renice 8 ,
818.Xr sysctl 8 ,
819.Xr vmstat 8
820.Sh HISTORY
821The
822.Nm
823program first appeared in
824.Bx 4.3 .
825.Sh BUGS
826Certain displays presume a minimum of 80 characters per line.
827The
828.Ic vmstat
829display looks out of place because it is (it was added in as
830a separate display rather than created as a new program).
831