1.\" $OpenBSD: systat.1,v 1.119 2020/06/22 13:17:54 kn 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 22 2020 $ 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 o 179Select the next ordering which sorts the rows according to a 180combination of columns. 181Available orderings depend on the view. 182Not all views support orderings. 183.It Ic p 184Pause 185.Nm . 186.It Ic q 187Quit 188.Nm . 189.It Ic r 190Reverse the selected ordering if supported by the view. 191.It Ic s 192Change the screen refresh interval in seconds. 193.It Ic \&, 194Print numbers with thousand separators, where applicable. 195.It Ic ^A | Aq Ic Home 196Jump to the beginning of the current view. 197.It Ic ^B | Aq Ic right arrow 198Select the previous view. 199.It Ic ^E | Aq Ic End 200Jump to the end of the current view. 201.It Ic ^F | Aq Ic left arrow 202Select the next view. 203.It Ic ^G 204Print the name of the current 205view being shown and the refresh interval. 206.It Ic ^L 207Refresh the screen. 208.It Ic ^N | Aq Ic down arrow 209Scroll current view down by one line. 210.It Ic ^P | Aq Ic up arrow 211Scroll current view up by one line. 212.It Ic ^V | Aq Ic Page Down 213Scroll current view down by one page. 214.It Ic Alt-V | Aq Ic Page Up 215Scroll current view up by one page. 216.El 217.Pp 218The following commands are interpreted by the 219.Dq global 220command interpreter. 221.Bl -tag -width Ds 222.It Ic help 223Print the names of the available views on the command line. 224.It Ic human 225Toggle human readable mode, where applicable. 226.It Ic order 227Print the names of the available orderings on the command line. 228.It Ic quit 229Quit 230.Nm . 231(This may be abbreviated to 232.Ic q . ) 233.It Ic stop 234Stop refreshing the screen. 235.It Xo 236.Op Ic start 237.Op Ar number 238.Xc 239Start (continue) refreshing the screen. 240If a second, numeric, 241argument is provided it is interpreted as a refresh interval 242(in seconds). 243Supplying only a number will set the refresh interval to this 244value. 245.El 246.Pp 247.Ar view 248may be abbreviated to the minimum unambiguous prefix. 249The available views are: 250.Bl -tag -width "netstatXXX" 251.It Ic buckets 252Display kernel 253.Xr malloc 9 254bucket statistics similar to the output of 255.Cm vmstat Fl m . 256.It Ic cpu 257Display information about the average usage of each CPU, 258similar to the output provided by 259.Xr top 1 . 260.It Ic ifstat 261Display interface statistics. 262The 263.Dq State 264column has the format 265.Sm off 266.Xo 267.Cm up | dn 268.Bq : Cm U | D . 269.Xc 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.It vnodepages 611pages used by vnode page cache 612.It vtextpages 613pages used by vtext vnodes 614.Pp 615.It Stats Counters: 616.It faults 617page fault count 618.It traps 619trap count 620.It intrs 621interrupt count 622.It swtch 623context switch count 624.It softs 625software interrupt count 626.It syscalls 627system calls 628.It pageins 629pagein operation count 630.It pgswapin 631pages swapped in 632.It pgswapout 633pages swapped out 634.It forks 635forks. 636.It forks_ppwait 637forks where parent waits 638.It forks_sharevm 639forks where vmspace is shared 640.It pga_zerohit 641pagealloc found requested zero'd pages 642.It pga_zeromiss 643pagealloc failed to obtain zero'd pages 644.Pp 645.It Fault Counters: 646.It fltnoram 647fault was out of ram 648.It fltnoanon 649fault was out of anons 650.It fltnoamap 651fault was out of amap chunks 652.It fltpgwait 653fault had to wait on a page 654.It fltpgrele 655fault found a released page 656.It fltrelck 657fault relock called 658.It fltrelckok 659fault relock was a success 660.It fltanget 661fault got anon page 662.It fltanretry 663fault retried an anon get 664.It fltamcopy 665fault cleared "needs copy" 666.It fltnamap 667fault mapped a neighbor anon page 668.It fltnomap 669fault mapped a neighbor obj page 670.It fltlget 671fault did a locked pgo_get 672.It fltget 673fault did an unlocked get 674.It flt_anon 675fault anon (case 1a) 676.It flt_acow 677fault anon cow (case 1b) 678.It flt_obj 679fault was on object page (2a) 680.It flt_prcopy 681fault promotes with copy (2b) 682.It flt_przero 683fault promotes with zerofill (2b) 684.Pp 685.It Pageout Params: 686.It freemin 687minimum number of free pages 688.It freetarg 689target number of free pages 690.It inactarg 691target number of inactive pages 692.It wiredmax 693maximum number of wired pages 694.It anonmin 695mininumu threshold for anon pages 696.It vtextmin 697minimum threshold for vtext pages 698.It vnodemin 699minimum threshold for vnode pages 700.It anonminpct 701minimum percent anon pages 702.It vtextminpct 703minimum percent vtext pages 704.It vnodeminpct 705minimum percent vnode pages 706.Pp 707.It Swap Counters: 708.It nswapdev 709configured swap devices 710.It swpages 711PAGE_SIZE'ed swap pages 712.It swpginuse 713swap pages in use 714.It swpgonly 715in use swap pages not in RAM 716.It nswget 717swap pages moved from disk to RAM 718.It nanon 719total anon's 720.Pp 721.It Daemon Counters: 722.It pdwoke 723times daemon woke up 724.It pdrevs 725times daemon rev'd clock hand 726.It pdswout 727times daemon called for swapout 728.It pdfreed 729pages daemon freed since boot 730.It pdscans 731pages daemon scanned since boot 732.It pdanscan 733anonymous pages scanned by daemon 734.It pdobscan 735object pages scanned by daemon 736.It pdreact 737pages daemon reactivated since boot 738.It pdbusy 739times daemon found a busy page 740.It pdpageouts 741times daemon started a pageout 742.It pdpending 743times daemon got a pending pagout 744.It pddeact 745pages daemon deactivates 746.Pp 747.It Misc Counters: 748.It fpswtch 749FPU context switches 750.It kmapent 751kernel map entries 752.Pp 753.It Constants: 754.It pagesize 755size of a page, always a power of 2 756.It pagemask 757page mask 758.It pageshift 759page shift 760.El 761.El 762.\".Pp 763.\"The following commands are specific to the 764.\".Ic vmstat 765.\"and 766.\".Ic ifstat 767.\"views; the minimum unambiguous prefix may be supplied. 768.\".Pp 769.\".Bl -tag -width Ds -compact 770.\".It Cm boot 771.\"Display cumulative statistics since the system was booted. 772.\".It Cm run 773.\"Display statistics as a running total from the point this 774.\"command is given. 775.\".It Cm time 776.\"Display statistics averaged over the refresh interval (the default). 777.\".It Cm zero 778.\"Reset running statistics to zero. 779.\".El 780.\".Pp 781.\"The following commands are common to each view which shows 782.\"information about disk drives. 783.\"These commands are used to select a set of drives to report on, 784.\"should a system have more drives configured 785.\"than can normally be displayed on the screen. 786.\".Pp 787.\".Bl -tag -width Tx -compact 788.\".It Cm display Op Ar drives 789.\"Display information about the drives indicated. 790.\"Multiple drives may be specified, separated by spaces. 791.\".It Cm ignore Op Ar drives 792.\"Do not display information about the drives indicated. 793.\"Multiple drives may be specified, separated by spaces. 794.\".El 795.Sh FILES 796.Bl -tag -width "/etc/servicesXXX" -compact 797.It Pa /etc/hosts 798Host names. 799.It Pa /etc/pf.conf 800.Xr pf 4 801configuration. 802.It Pa /etc/services 803Port names. 804.El 805.Sh SEE ALSO 806.Xr fstat 1 , 807.Xr kill 1 , 808.Xr netstat 1 , 809.Xr nfsstat 1 , 810.Xr ps 1 , 811.Xr top 1 , 812.Xr iostat 8 , 813.Xr pfctl 8 , 814.Xr pstat 8 , 815.Xr renice 8 , 816.Xr sysctl 8 , 817.Xr vmstat 8 818.Sh HISTORY 819The 820.Nm 821program first appeared in 822.Bx 4.3 . 823.Sh BUGS 824Certain displays presume a minimum of 80 characters per line. 825The 826.Ic vmstat 827display looks out of place because it is (it was added in as 828a separate display rather than created as a new program). 829