==>sar of Linux monitoring commands

Source: Internet
Author: User
Tags disk usage

I. Description of Use

SAR is one of the most comprehensive system performance analysis tools available on Linux, which can be used to report the activity of the systems, including the reading and writing of files, the usage of system calls, disk I/O, CPU efficiency, memory usage, process activities and IPC-related activities.

Second, parameter description

    • -A: Sum of all reports
    • -U: Displays statistics about CPU usage
    • -V: Displays statistics for inode, files, and other kernel tables
    • -P: Displays the specified CPU usage information for the current system
    • -D: Display hard disk usage information
    • -R: Displays statistics for memory and swap intervals
    • -N: Displays network operational status. Parameters can be followed by Dev, Edev, sock, and full. Dev Display network interface information, EDEV Display network error statistics, sock display socket information, full display the first three parameters all information
    • -Q: Displays the size of the running queue, which is the same as the average load at the time of the system
    • -B: Display memory paging situation
    • -R: Shows the activity of the process during the sampling time
    • -G: Display of serial I/O
    • -B: Show buffer usage
    • -A: File read and write status
    • -C: Show process statistics, number of processes created per second
    • -R: Shows the activity of the process
    • -Y: Display terminal equipment activity situation
    • -W: Display system Exchange activity information

Iii. Introduction of Usage

1. CPU Resource Monitoring

Every 2 seconds to the screen to output CPU usage information, a total output of 3 times, you can also omit-U is not lost, such as:

    • Cpu:all represents the average of the statistics for all CPUs.
    • %user: Percentage of CPU time consumed by the user process.
    • %nice: The percentage of CPU time that is consumed by running the normal process.
    • %system: The percentage of CPU time that the system process consumes.
    • %IOWAIT:I/O the percentage of CPU time that the wait is taken.
    • %steal: In a memory-intensive environment, Pagein enforces steal operations on different pages
    • The percentage of time%idle:cpu idle state.
    • In all the display, we should pay attention to the value of%iowait and%idle,%iowait is too high, indicating that there is an I/O bottleneck on the hard disk, the%idle value is high, the CPU is idle, if the%idle value is high but the system response is slow, it is possible that the CPU waits to allocate memory, this should increase the memory capacity. If the%idle value continues below 10, the system's CPU processing power is relatively low, indicating that the most resource to be addressed in the system is the CPU.

2.inode, file, and other kernel table monitoring

sample every 2 seconds, 3 consecutive samples , observe the status of the core table

    • DENTUNUSD: Number of unused entries in the directory cache
    • FILE-NR: The number of file handles (files handle) used
    • INODE-NR: Number of uses of the index node handle (inode handle)
    • PTY-NR: Number of Pty used

3. Memory and swap space monitoring

samples are sampled every 2 seconds, 3 times in a row, and memory paging is monitored . can also not specify the number of times, has been monitored, such as:

    • Kbmemfree: This value is basically the same as the free value in the command, so it does not include buffer and cache space
    • Kbmemused: This value is basically the same as the used value in the free command, so it includes buffer and cache space
    • %memused: This value is a percentage of kbmemused and total memory (excluding swap)
    • Kbbuffers and kbcached: These two values are the buffer and cache in the free command
    • Kbcommit: The memory required to guarantee the current system, i.e. the memory required to ensure no overflow (RAM+SWAP)
    • %commit: This value is a percentage of kbcommit and total memory (including swap)

4, Memory paging monitoring

    • PGPGIN/S: Indicates the number of bytes per second from disk or swap to memory (KB)
    • PGPGOUT/S: Indicates the number of bytes per second from memory to disk or swap (KB)
    • FAULT/S: The number of pages per second that the system generates, that is, the sum of the main pages and the second page of pages (major + minor)
    • MAJFLT/S: Number of main pages generated per second
    • PGFREE/S: Number of pages per second that are placed in the free queue
    • PGSCANK/S: Number of pages scanned per second by KSWAPD
    • PGSCAND/S: Number of pages scanned directly per second
    • PGSTEAL/S: The number of pages per second that are purged from the cache to meet memory requirements
    • %vmeff: Percentage of pages purged per second (pgsteal) in total scan page (Pgscank+pgscand)

5. I/O and transfer rate monitoring

    • TPS: Total I/O transfers per second for physical devices
    • Rtps: Total amount of data read from physical devices per second
    • Wtps: The total amount of data written to the physical device per second
    • BREAD/S: The amount of data read from the physical device per second, in blocks/s
    • BWRTN/S: The amount of data written to the physical device per second, in blocks/s

6. Process Queue Length and average load status monitoring

    • Runq-sz: Length of the run queue (number of processes waiting to run)
    • Plist-sz: Number of processes (processes) and threads (threads) in the process list
    • Ldavg-1: Average system load for last 1 minutes (systems load average)
    • Ldavg-5: System average load over the last 5 minutes
    • Ldavg-15: System average load over the last 15 minutes

7, System Exchange activity information monitoring

    • PSWPIN/S: Number of swap pages per second system swapped in (Swap page)
    • PSWPOUT/S: Number of swap pages per second system swapped out (Swap page)

8. Monitoring of equipment usage

    • TPS: Number of times per second from physical disk I/O. Multiple logical requests are merged into one I/O disk request, the size of one transfer is indeterminate
    • RD_SEC/S: Number of Read sectors per second
    • WR_SEC/S: Number of write sectors per second
    • Avgrq-sz: Average data size Per device I/O operation (Sector)
    • Avgqu-sz: Average length of the disk request queue
    • Await: The average elapsed time of each request, including the request queue wait time, in milliseconds (1 seconds =1000 milliseconds), from the request disk operation to the completion of the system processing
    • SVCTM: The average time that the system processes each request, excluding the time consumed in the request queue
    • %UTIL:I/O requests account for the percentage of CPU, the higher the ratio, the more saturated the description
    • When the value of 1.avgqu-sz is low, the equipment utilization is higher
    • 2. When the value of%util is close to 1%, it indicates that the device bandwidth is already full

Iv. Performance Analysis Help

To determine the system bottleneck, it is sometimes necessary to combine several SAR command options:

1, suspected CPU bottleneck, you can use Sar–u and sar–q to view
2. Suspected memory bottleneck, can use Sar–b, sar–r and sar–w to view
3, suspected I/O bottlenecks, can use Sar–b, sar–u and sar–d to view

==>sar of Linux monitoring commands

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.