Linux System Management Tools SAR (i)

Source: Internet
Author: User

Linux System Management Tools SAR

  1. Monitor network card traffic
    #sar-N DEV 1 1 (1 times in 1 seconds) Linux 3.10.0-123.9.3.el7.x86_64 (Iz25wvw5wozz) 01/22/2018 _x86_64_ (CPU) 03:08:01 PM      IFACE rxpck/s txpck/s rxkb/s txkb/s rxcmp/s txcmp/s rxmcst/s03:08:02 PM cni0 0.00 0.00      0.00 0.00 0.00 0.00 0.0003:08:02 PM eth0 911.00 740.00 209.74 244.55 0.00        0.00 0.0003:08:02 PM eth1 0.00 64.00 0.00 67.41 0.00 0.00 0.0003:08:02 PM      Lo 13.00 13.00 0.69 0.69 0.00 0.00 0.0003:08:02 PM FLANNEL.1 0.00 0.00      0.00 0.00 0.00 0.00 0.0003:08:02 PM DOCKER0 0.00 0.00 0.00 0.00 0.00         0.00 0.00average:iface rxpck/s txpck/s rxkb/s txkb/s rxcmp/s txcmp/s rxmcst/saverage: Cni0 0.00 0.00 0.00 0.00 0.00 0.00 0.00average:eth0 911.00 740.00 209 .74 244.55 0.00     0.00 0.00average:eth1 0.00 64.00 0.00 67.41 0.00 0.00 0.00Average:      Lo 13.00 13.00 0.69 0.69 0.00 0.00 0.00AVERAGE:FLANNEL.1 0.00 0.00      0.00 0.00 0.00 0.00 0.00AVERAGE:DOCKER0 0.00 0.00 0.00 0.00 0.00 0.00 0.00 Note: sar-n DEV View network traffic information for the current server rxpck/s: Number of packages per second txpck/s: Number of packets per second

    Description
    (1) RXPCK/S: The number of packets received per second.
    (2) TXPCK/S: The number of packets sent per second.
    (3) rxkb/s: Bytes received per second (KB).
    (4) txkb/s: Bytes sent per second (KB).
    (5) RXCMP/S: The number of compressed packets received per second
    (6) TXCMP/S: The number of compressed packets issued per second
    (7) RXMCST/S: Number of broadcast packets received per second
    The data from the network device is derived from/proc/net/dev.
    I try to use the compression function of SSH to transfer, the result also did not see the number of compressed package changes.

  2. Monitor CPU Resources
      #sar 1 (Consolidate all CPUs together for monitoring) 03:08:57 PM CPU%user%nice%system%iowait%steal%idle03:08:5      8 pm All 5.47 0.00 5.97 2.58 0.06 85.9103:08:59 PM all 5.85 0.00 6.29     2.33 0.06 85.4603:09:00 pm All 4.76 0.00 6.27 1.57 0.06 87.3403:09:01 PM All 6.67 0.00 6.17 1.83 0.13 85.2103:09:02 PM all 4.97 0.00 6.35 1.      0.06 87.3003:09:03 pm All 4.47 0.00 6.30 0.00 0.06 89.1703:09:04 PM All 3.95 0.00 5.71 0.00 0.06 90.27 .....      03:09:07 PM all 3.87 0.00 6.08 0.00 0.55 89.50average:all 4.92 0.00 6.04 0.97 0.07 88.01  
    #sar-P All 1 1 (can display the current load per CPU) 03:10:08 PM CPU%user%nice%system%iowait%steal%idle03:10:09 P     M All 6.21 0.00 6.65 3.32 0.13 83.6903:10:09 PM 0 30.21 0.00 10.42       52.08 0.00 7.2903:10:09 PM 1 8.00 0.00 1.00 2.00 0.00 89.0003:10:09 PM      2 4.00 0.00 1.00 0.00 0.00 95.0003:10:09 PM 3 0.00 0.00 0.00 0.00      0.00 100.0003:10:09 PM 4 1.98 0.00 0.99 0.00 0.99 96.0403:10:09 PM 5 3.00 0.00 1.00 0.00 0.00 96.0003:10:09 PM 6 2.00 0.00 1.00 0.00 0.     97.0003:10:09 PM 7 14.14 0.00 85.86 0.00 0.00 0.00AVERAGE:CPU%user     %nice%system%iowait%steal%idleaverage:all 6.21 0.00 6.65 3.32 0.13 83.69average:0     30.21 0.00 10.42 52.08 0.00 7.29average:1 8.00 0.00 1.00 2.00 0.00 89.00average:2 4.00 0.00 1.00 0.00 0.00 95.00average:3 0      .0.00 0.00 0.00 0.00 100.00average:4 1.98 0.00 0.99 0.00 0.99      96.04average:5 3.00 0.00 1.00 0.00 0.00 96.00average:6 2.00 0.00 1.00 0.00 0.00 97.00average:7 14.14 0.00 85.86 0.00 0.00 0 .00

    Description:%user,%system,%iowait,%idle indicates that the user state process consumes CPU percentage, the System State process consumes CPU percentage, CPU waits IO percentage, cpu idle percentage.
    The emphasis is on%nice and%steal, which Vmstat does not have.
    %nice: If a program at run time with nice to adjust its priority, and priority in between 1-19, and is a user-state process, then%nice will be reflected,%steal: generally run virtual machine in the host to use, such as Xen,qemu,bochs and so on.

  3. Monitoring Memory resources
    #sar-R 103:20:55 PM kbmemfree kbmemused%memused kbbuffers kbcached kbcommit%commit kbactive kbinact kbdirty03   : 20:56 pm 1754084 14239212 89.03 204100 2997052 25525216 159.60 12852348 805468 003:20:57 PM 1753824 14239472 89.03 204100 2997456 25525216 159.60 12852572 805740 003:20:58 PM 1753668 1     4239628 89.03 204100 2997704 25525216 159.60 12852640 805904 003:20:59 PM 1753200 14240096 89.04 204108 2997936 25525216 159.60 12852728 806048 003:21:00 PM 1752548 14240748 89.04 2 04108 2998116 25525176 159.60 12852812 806244 003:21:01 PM 1751756 14241540 89.05 204108 299 8868 25525176 159.60 12853020 806808 0 .....      03:21:01 PM 1749996 14243300 89.06 204112 3001284 25526988 159.61 12854832 807716 0Average: 1752725 14240571 89.04 204105 2998345 25525458 159.60 12852993 806275 0 

    Description
    (1) Kbmemfree: This value is basically the same as the free value in the command, so it does not include buffer and cache space.
    (2) Kbmemused: This value is basically the same as the used value in the free command, so it includes buffer and cache space.
    (3)%memused: This value is a percentage of kbmemused and total memory (excluding swap).
    (4) Kbbuffers and kbcached: These two values are the buffer and cache in the free command.
    (5) Kbcommit: Ensure that the current system requires memory (RAM+SWAP) in order to ensure that it does not overflow.
    (6)%commit: This value is a percentage of kbcommit and total memory (including swap).
    Contrast:

    #free -h                 total        used        free      shared  buff/cache   availableMem:            15G         10G        1.6G        777M        3.4G        3.9GSwap:            0B          0B          0B
  4. Monitoring Memory Paging
    #sar-B 103:33:33 pm PGPGIN/S pgpgout/s fault/s majflt/s pgfree/s pgscank/s pgscand/s pgsteal/s%vmeff03:33:34 PM    0.00 14504.00 3192.00 0.00 8984.00 0.00 0.00 0.00 0.0003:33:35 PM 0.00 0.00   866.00 0.00 3294.00 0.00 0.00 0.00 0.0003:33:36 PM 0.00 256.00 845.00 0.00      3711.00 0.00 0.00 0.00 0.0003:33:37 PM 0.00 19964.00 4765.00 0.00 3803.00 0.00      0.00 0.00 0.0003:33:38 PM 0.00 10620.00 3029.00 0.00 8643.00 0.00 0.00 0.00      0.0003:33:39 pm 0.00 26956.00 6252.00 0.00 4644.00 0.00 0.00 0.00 0.0003:33:40 PM 0.00 26208.00 5834.00 0.00 12574.00 0.00 0.00 0.00 0.00 .....   03:33:40 PM 0.00 20524.44 4968.89 0.00 15342.22 0.00 0.00 0.00 0.00average:0.00 14462.28 3626.71 0.00 7054.63 0.00 0.00 0.00 0.00 

    Description
    (1) PGPGIN/S: The number of bytes per second that are displaced from disk or swap to memory (KB)
    (2) PGPGOUT/S: The number of bytes per second that are swapped from memory to disk or swap (KB)
    (3) FAULT/S: The number of pages per second that the system generates, that is, the sum of the primary and secondary page faults (major + minor)
    (4) MAJFLT/S: The number of main pages generated per second
    (5) pgfree/s: Number of pages per second that are placed in the idle queue
    (6) pgscank/s: Number of pages scanned by KSWAPD per second
    (7) pgscand/s: Number of pages scanned directly per second
    (8) PGSTEAL/S: The number of pages per second that are purged from the cache to meet memory requirements
    (9)%vmeff: The percentage of pages (Pgsteal) purged per second that are the Total Scan page (Pgscank+pgscand).

  5. Monitoring of I nodes, files and other kernel tables
    #sar -v 103:41:43 PM dentunusd   file-nr  inode-nr    pty-nr03:41:44 PM     38321      3296     22449         203:41:45 PM     38327      3296     22455         203:41:46 PM     38329      3296     22446         203:41:47 PM     38329      3296     22448         203:41:48 PM     38331      3296     22447         203:41:49 PM     38331      3296     22447         203:41:50 PM     38331      3296     22447         203:41:51 PM     38336      3296     22448         2。。。。03:41:51 PM     38336      3296     22449         2Average:        38330      3296     22448         2

    Description
    (1) DENTUNUSD: The number of entries not used in the buffer directory entry.
    The data source of the DENTUNUSD data is the second data of the/proc/sys/fs/dentry-state.
    To understand its meaning, we first have to understand the Dcache (directory cache), because all the inode in the system is accessed through the file name, and in order to resolve the file name to the Inode conversion time, the introduction of Dcache.
    It is a cache that the VFS layer maintains for the current activity and the recently used name.
    All Dentry objects in the Dcache in the unused state and negative (negative) states are linked into the dentry_unused list, which may be freed when the memory is reclaimed.
    If we run ls-ltr/etc/in the system, we will see that the number of DENTUNUSD will be more.
    And through Mount-o REMOUNT/DEV/SDA1 will see DENTUNUSD will be quickly recycled.
    (2) File-nr: The number of file handles used by the system.
    The FILE-NR data source is the first data in the/proc/sys/fs/file-nr file.
    In fact, FILE-NR is not an accurate value, file-nr each increment is 64 (64-bit system), for example, now FILE-NR is 2528, may actually only open 2,527 files, and when you open two files, it will become 2592, instead of 2530.
    (3) Inode-nr: The number of index nodes used.
    The data source for INODE-NR is the value of the first item of the/proc/sys/fs/inode-nr file minus the second item of data.
    The first data for the Inode-nr file is an inode node that has already been allocated. The second data is an idle inode node.
    For example, the value in the Inode-nr file is: 13720 7987
    We create a new file File1, at this time INODE-NR the first data will be added 1, that is, 13721, indicating that there are so many inode set up in the system.
    We'll delete the file1 again, and it will turn 13720.
    The idle inode node indicates that so many inode nodes have been exploited, but not released.
    So the total number of inode nodes minus the idle inode is the inode that is being used.
    Finally, by using the Mount-o remount/dev/sda1 command, the idle node is refreshed, so the value of the INODE-NR changes.
    (4) PTY-NR: Number of Pty used.
    The data source for PTY-NR is/PROC/SYS/KERNEL/PTY/NR
    Indicates the total number of terminals logged in, if we log in 10 back, Exit 3, the final result is 10 back.

  6. Monitoring interrupts
    #sar -I ALL  103:47:59 PM      INTR    intr/s03:48:00 PM         0      0.0003:48:00 PM         1      0.0003:48:00 PM         2      0.0003:48:00 PM         3      0.0003:48:00 PM         4      0.0003:48:00 PM         5      0.0003:48:00 PM         6      0.0003:48:00 PM         7      0.00

    Description
    (1) INTR indicates the interrupt number, the meaning of the interrupt number can be/proc/interrupts query.
    (2) intr/s indicates the number of interrupts per second.

  7. Average load and queue monitoring
    #sar -q 104:08:37 PM   runq-sz  plist-sz   ldavg-1   ldavg-5  ldavg-15   blocked04:08:38 PM         1      2274      2.24      2.55      2.68         004:08:39 PM         3      2274      2.24      2.55      2.68         104:08:40 PM         2      2274      2.24      2.55      2.68         004:08:41 PM         2      2274      2.24      2.55      2.68         004:08:42 PM         1      2274      2.14      2.53      2.67         004:08:43 PM         2      2274      2.14      2.53      2.67         0。。。。04:08:44 PM         3      2274      2.14      2.53      2.67         0Average:            2      2274      2.20      2.54      2.68         0

    Description
    (1) Runq-sz: Number of processes running or ready
    (2) Plist-sz: The total number of processes now (including threads).
    (3) Ldavg-1: Last minute load.
    (4) Ldavg-5: Last five minutes of load.
    (5) Ldavg-15: Last 10 minutes of load.
    (6) Average load and queue data from/proc/loadavg

Linux System Management Tools SAR (i)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.