xref: /openbsd-src/usr.bin/systat/systat.1 (revision 8304c2525b687ea1cde1f5e35c6c1af5f8091220)
1.\"	$OpenBSD: systat.1,v 1.124 2025/01/23 11:05:26 mpi 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: January 23 2025 $
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.Cm up | dn
269.Bq : Cm U | D .
270.Sm on
271.Sq up
272and
273.Sq dn
274represent whether the interface is up or down.
275.Sq U
276and
277.Sq D
278represent whether the interface is connected or not;
279in the case of
280.Xr carp 4
281interfaces, whether the interface is in master or backup state, respectively.
282.Pp
283The character
284.Ic B
285changes the counter view between bytes and bits.
286Pressing
287.Ic b
288displays statistics as calculated from boot time.
289.Ic r
290changes the counters to show their totals as calculated
291between display refreshes.
292.Ic t
293changes the counters to show the average per second over
294the display refresh interval;
295this is the default.
296.Ic d
297displays input and output queue drops.
298.Ic e
299displays input and output errors.
300.Ic f
301displays input and output queue drops plus errors.
302This is the default view.
303.It Ic iostat
304Display statistics about disk throughput.
305Statistics
306on disk throughput show, for each drive, data transferred in bytes,
307number of disk transactions performed, and time spent in disk accesses
308(in fractions of a second).
309Pressing
310.Ic b
311displays statistics as calculated from boot time.
312.Ic t
313changes the counters to show the average per second over
314the display refresh interval;
315this is the default.
316.It Ic malloc
317Display kernel
318.Xr malloc 9
319type statistics similar to the output of
320.Cm vmstat Fl m .
321Available orderings are:
322.Ic name ,
323.Ic inuse ,
324.Ic memuse ,
325and
326.Ic requests .
327.It Ic mbufs
328Display mbuf usage information from kernel pools
329and mbuf cluster pool statistics of each network interface.
330.It Ic netstat
331Display network connections.
332Each address
333is displayed numerically in the format
334.Dq host:port .
335By default, network servers awaiting requests are not displayed.
336It is also possible to have addresses displayed symbolically,
337when possible, and limit the display to a set of protocols
338(the minimum unambiguous prefix may be supplied):
339.Bl -tag -width Ar
340.It Cm all
341Toggle the displaying of server processes awaiting requests (this
342is the equivalent of the
343.Fl a
344flag to
345.Xr netstat 1 ) .
346.It Cm names
347Display network addresses symbolically.
348.It Cm numbers
349Display network addresses numerically.
350.It Cm reset
351Reset matching mechanisms to the default.
352.\".It Cm show Oo
353.\".Ar protocols | ports | hosts
354.\".Oc
355.\"Show, on the command line, the currently selected protocols,
356.\"hosts, and ports.
357.\"Protocols, hosts and ports which are being ignored are prefixed with a
358.\".Ql \&! .
359.\"If an argument is supplied to
360.\".Cm show ,
361.\"then only the requested information will be displayed.
362.It Cm tcp | udp | other
363Display only network connections using the indicated protocol.
364.El
365.It Ic nfsclient
366Display statistics about NFS client activity.
367Output resembles
368.Cm nfsstat Fl c .
369.It Ic nfsserver
370Display statistics about NFS server activity.
371Output resembles
372.Cm nfsstat Fl s .
373.It Ic pf
374Display filter information about
375.Xr pf 4 ,
376similar to the output of
377.Cm pfctl Fl s Cm info
378option.
379.It Ic pigs
380Display those processes resident in main
381memory and getting the
382largest portion of the processor.
383When less than 100% of the
384processor is scheduled to user processes, the remaining time
385is accounted to the
386.Dq idle
387process.
388.It Ic pool
389Display kernel
390.Xr pool 9
391statistics similar to the output of
392.Cm vmstat Fl m .
393Available orderings are:
394.Ic name ,
395.Ic requests ,
396.Ic size ,
397and
398.Ic number of pages .
399.Pp
400By default only the statistics of active pools are displayed but pressing
401.Ic A
402changes the view to show all of them.
403.It Ic pcache
404Display kernel
405.Xr pool 9
406per CPU cache statistics.
407Ordering is available on all columns.
408.It Ic queues
409Display statistics about the active queues,
410similar to the output of
411.Cm pfctl Fl s Cm queue .
412.It Ic rules
413Display pf rules statistics, similar to the output of
414.Cm pfctl Fl s Cm rules .
415.It Ic sensors
416Display the current values of available hardware sensors,
417in a format similar to that of
418.Xr sysctl 8 .
419.It Ic states
420Display pf states statistics, similar to the output of
421.Cm pfctl Fl s Cm states .
422Available orderings are:
423.Ic none ,
424.Ic bytes ,
425.Ic expiry ,
426.Ic packets ,
427.Ic age ,
428.Ic source address ,
429.Ic source port ,
430.Ic destination address ,
431.Ic destination port ,
432.Ic rate ,
433and
434.Ic peak
435columns.
436.It Ic swap
437Show information about swap space usage on all the
438swap areas compiled into the kernel.
439The first column is the device name of the partition.
440The next column is the total space available in the partition.
441The
442.Ar Used
443column indicates the total blocks used so far;
444the graph shows the percentage of space in use on each partition.
445If there is more than one swap partition in use,
446a total line is also shown.
447Areas known to the kernel but not in use are shown as not available.
448.It Ic vmstat
449Take over the entire display and show a (rather crowded) compendium
450of statistics related to virtual memory usage, process scheduling,
451device interrupts, system name translation caching, disk I/O, etc.
452This view is the default.
453.Pp
454Below the top line are statistics on memory utilization.
455The first row of the table reports memory usage only among
456active processes, that is, processes that have run in the previous
457twenty seconds.
458The second row reports on memory usage of all processes.
459The first column reports on the amount of physical memory
460claimed by processes.
461The second column reports the same figure for
462virtual memory, that is, the amount of memory that would be
463needed if all processes were resident at the same time.
464Finally, the last column shows the amount of physical memory
465on the free list.
466.Pp
467Below the memory display is a list of the average number of processes
468(over the last refresh interval) that are runnable
469.Pq Sq r ,
470in disk wait other than paging
471.Pq Sq d ,
472sleeping
473.Pq Sq s ,
474and swapped out but desiring to run
475.Pq Sq w .
476Below the queue length listing is a numerical listing and
477a bar graph showing the amount of
478interrupt (shown as
479.Ql | ) ,
480spinning (shown as
481.Ql @ ) ,
482system (shown as
483.Ql = ) ,
484user plus nice (shown as
485.Ql > ) ,
486and idle time (shown as
487.Ql \ \& ) .
488.Pp
489To the right of the Proc display are statistics about
490Context switches
491.Pq Dq Csw ,
492Traps
493.Pq Dq Trp ,
494Syscalls
495.Pq Dq Sys ,
496Interrupts
497.Pq Dq Int ,
498Soft interrupts
499.Pq Dq Sof ,
500and Faults
501.Pq Dq Flt
502which have occurred during the last refresh interval.
503.Pp
504Below the CPU usage graph are statistics on name translations.
505It lists the number of names translated in the previous interval,
506the number and percentage of the translations that were
507handled by the system wide name translation cache, and
508the number and percentage of the translations that were
509handled by the per process name translation cache.
510.Pp
511At the bottom left is the disk usage display.
512It reports the number of seeks, transfers, number
513of kilobyte blocks transferred per second averaged over the
514refresh period of the display, and
515the time spent in disk accesses.
516.Pp
517Under the date in the upper right hand quadrant are statistics
518on paging and swapping activity.
519The first two columns report the average number of pages
520brought in and out per second over the last refresh interval
521due to page faults and the paging daemon.
522The third and fourth columns report the average number of pages
523brought in and out per second over the last refresh interval
524due to swap requests initiated by the scheduler.
525The first row of the display shows the average
526number of disk transfers per second over the last refresh interval.
527The second row of the display shows the average
528number of pages transferred per second over the last refresh interval.
529.Pp
530Running down the right hand side of the display is a breakdown
531of the interrupts being handled by the system.
532At the top of the list is the total interrupts per second
533over the time interval.
534The rest of the column breaks down the total on a device
535by device basis.
536Only devices that have interrupted at least once since boot time are shown.
537.Pp
538Below the Interrupts display are
539the average number of input and output packets per second
540for all interfaces over the last refresh interval.
541.Pp
542Below the SWAPPING display and slightly to the left of the Interrupts
543display is a list of virtual memory statistics.
544The abbreviations are:
545.Pp
546.Bl -tag -compact -width "kmapentXX" -offset indent
547.It forks
548process forks
549.It fkppw
550forks where parent waits
551.It fksvm
552forks where vmspace is shared
553.It pwait
554fault had to wait on a page
555.It relck
556fault relock called
557.It rlkok
558fault relock is successful
559.It noram
560faults out of ram
561.It ndcpy
562number of times fault clears "need copy"
563.It fltcp
564number of times fault promotes with copy
565.It zfod
566fault promotes with zerofill
567.It cow
568number of times fault anon cow
569.It fmin
570min number of free pages
571.It ftarg
572target number of free pages
573.It itarg
574target number of inactive pages
575.It wired
576wired pages
577.It pdfre
578pages daemon freed since boot
579.It pdscn
580pages daemon scanned since boot
581.It pzidl
582number of zeroed pages
583.It kmape
584number of kernel map entries
585.El
586.It Ic uvm
587Display statistics relevant to the UVM subsystem.
588The statistics are divided into eight groups.
589.Pp
590.Bl -tag -compact -width "reserve_pagedaemon" -offset indent
591.It Page Counters:
592.It npages
593pages managed by UVM
594.It free
595free pages
596.It active
597active pages
598.It inactive
599freed pages that may be wanted back
600.It paging
601pages in the process of being paged out
602.It wired
603wired pages
604.It zeropages
605zero'd pages
606.It reserve_pagedaemon
607pages reserved for pagedaemon
608.It reserve_kernel
609pages reserved for kernel.
610.Pp
611.It Stats Counters:
612.It faults
613page fault count
614.It traps
615trap count
616.It intrs
617interrupt count
618.It swtch
619context switch count
620.It softs
621software interrupt count
622.It syscalls
623system calls
624.It pageins
625pagein operation count
626.It pgswapin
627pages swapped in
628.It pgswapout
629pages swapped out
630.It forks
631forks.
632.It forks_ppwait
633forks where parent waits
634.It forks_sharevm
635forks where vmspace is shared
636.It pga_zerohit
637pagealloc found requested zero'd pages
638.It pga_zeromiss
639pagealloc failed to obtain zero'd pages
640.Pp
641.It Fault Counters:
642.It fltnoram
643fault was out of ram
644.It fltnoanon
645fault was out of anons
646.It fltnoamap
647fault was out of amap chunks
648.It fltpgwait
649fault had to wait on a page
650.It fltpgrele
651fault found a released page
652.It fltrelck
653fault relock called
654.It fltrelckok
655fault relock was a success
656.It fltanget
657fault got anon page
658.It fltanretry
659fault retried an anon get
660.It fltamcopy
661fault cleared "needs copy"
662.It fltnamap
663fault mapped a neighbor anon page
664.It fltnomap
665fault mapped a neighbor obj page
666.It fltlget
667fault did a locked pgo_get
668.It fltget
669fault did an unlocked get
670.It flt_anon
671fault anon (case 1a)
672.It flt_acow
673fault anon cow (case 1b)
674.It flt_obj
675fault was on object page (2a)
676.It flt_prcopy
677fault promotes with copy (2b)
678.It flt_przero
679fault promotes with zerofill (2b)
680.Pp
681.It Pageout Params:
682.It freemin
683minimum number of free pages
684.It freetarg
685target number of free pages
686.It inactarg
687target number of inactive pages
688.It wiredmax
689maximum number of wired pages
690.Pp
691.It Per-CPU Counters:
692.It pcphit
693pages allocated from a per-CPU cache since boot
694.It pcpmiss
695times a per-CPU cache was empty when allocating a page
696.Pp
697.It Swap Counters:
698.It nswapdev
699configured swap devices
700.It swpages
701PAGE_SIZE'ed swap pages
702.It swpginuse
703swap pages in use
704.It swpgonly
705in use swap pages not in RAM
706.It nswget
707swap pages moved from disk to RAM
708.It nanon
709total anon's
710.Pp
711.It Daemon Counters:
712.It pdwoke
713times daemon woke up
714.It pdrevs
715times daemon rev'd clock hand
716.It pdswout
717times daemon called for swapout
718.It pdfreed
719pages daemon freed since boot
720.It pdscans
721pages daemon scanned since boot
722.It pdanscan
723anonymous pages scanned by daemon
724.It pdobscan
725object pages scanned by daemon
726.It pdreact
727pages daemon reactivated since boot
728.It pdbusy
729times daemon found a busy page
730.It pdpageouts
731times daemon started a pageout
732.It  pdpending
733times daemon got a pending pagout
734.It pddeact
735pages daemon deactivates
736.Pp
737.It Misc Counters:
738.It fpswtch
739FPU context switches
740.It kmapent
741kernel map entries
742.Pp
743.It Constants:
744.It pagesize
745size of a page, always a power of 2
746.It pagemask
747page mask
748.It pageshift
749page shift
750.El
751.El
752.\".Pp
753.\"The following commands are specific to the
754.\".Ic vmstat
755.\"and
756.\".Ic ifstat
757.\"views; the minimum unambiguous prefix may be supplied.
758.\".Pp
759.\".Bl -tag -width Ds -compact
760.\".It Cm boot
761.\"Display cumulative statistics since the system was booted.
762.\".It Cm run
763.\"Display statistics as a running total from the point this
764.\"command is given.
765.\".It Cm time
766.\"Display statistics averaged over the refresh interval (the default).
767.\".It Cm zero
768.\"Reset running statistics to zero.
769.\".El
770.\".Pp
771.\"The following commands are common to each view which shows
772.\"information about disk drives.
773.\"These commands are used to select a set of drives to report on,
774.\"should a system have more drives configured
775.\"than can normally be displayed on the screen.
776.\".Pp
777.\".Bl -tag -width Tx -compact
778.\".It Cm display Op Ar drives
779.\"Display information about the drives indicated.
780.\"Multiple drives may be specified, separated by spaces.
781.\".It Cm ignore Op Ar drives
782.\"Do not display information about the drives indicated.
783.\"Multiple drives may be specified, separated by spaces.
784.\".El
785.Sh FILES
786.Bl -tag -width "/etc/servicesXXX" -compact
787.It Pa /etc/hosts
788Host names.
789.It Pa /etc/pf.conf
790.Xr pf 4
791configuration.
792.It Pa /etc/services
793Port names.
794.El
795.Sh SEE ALSO
796.Xr fstat 1 ,
797.Xr kill 1 ,
798.Xr netstat 1 ,
799.Xr nfsstat 1 ,
800.Xr ps 1 ,
801.Xr top 1 ,
802.Xr iostat 8 ,
803.Xr pfctl 8 ,
804.Xr pstat 8 ,
805.Xr renice 8 ,
806.Xr sysctl 8 ,
807.Xr vmstat 8
808.Sh HISTORY
809The
810.Nm
811program first appeared in
812.Bx 4.3 .
813.Sh BUGS
814Certain displays presume a minimum of 80 characters per line.
815The
816.Ic vmstat
817display looks out of place because it is (it was added in as
818a separate display rather than created as a new program).
819