Linux:sar Monitoring Commands

Source: Internet
Author: User

Sar
Sar-u Monitoring CPU
[Email protected] ~]# sar-u
Linux 2.6.32-358.el6.i686 (Test1) 03/26/2015 _i686_ (1 CPU)

11:08:23 PM LINUX RESTART

11:10:02 PM CPU%user%nice%system%iowait%steal%idle
11:20:01 PM all 0.05 0.00 1.12 1.04 0.00 97.79
Average:all 0.05 0.00 1.12 1.04 0.00 97.79

%USR: Percentage of CPU time consumed by user processes
%nice: Percentage of CPU time consumed by running a normal process
%system: Percentage of time that the system process consumes CPU
%IOWAIT:I/O percentage of time that the CPU is waiting to be occupied
%steal: In a memory-intensive environment, Pagein forces steal operations on different pages
%IDLE:CPU idle state percent of time
In all the display, you should pay attention to%iowait and%idle,%iowait values too high, indicating that there is an I/O bottleneck on the hard disk, high%idle value, indicating that 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. In this case, the memory capacity should be increased, if the%idle value continues to be less than 10, then the system CPU is relatively low, indicating that the most necessary resource bottleneck in the system is the CPU.

Sar-v 3 5 SAR monitoring inode, files, and other kernel tables
[Email protected]/]# SAR-V 3 5
Linux 2.6.32-358.el6.i686 (Test1) 03/27/2015 _i686_ (1 CPU)

12:22:40 AM DENTUNUSD file-nr inode-nr pty-nr
12:22:43 AM 29225 1056 36515 2
12:22:46 AM 29225 1056 36515 2
12:22:49 AM 29225 1056 36515 2
12:22:52 AM 29225 1056 36515 2
Indove-sz: The number of table entries in the node table currently being used or allocated in the core, controlled by the core parameter Max-inode
File-sz: The number of table entries in the file table currently being used or allocated in the core, controlled by the core parameter max-file.
Super-sz: Number of overflow occurrences
DENTUNUSD: Number of entries not used in the directory cache

Sar-r 2 4 monitor memory and swap space
[[email protected]/]# Sar-r 2 4 monitor memory and swap space
Linux 2.6.32-358.el6.i686 (Test1) 03/27/2015 _i686_ (1 CPU)

01:00:35 AM kbmemfree kbmemused%memused kbbuffers kbcached kbcommit%commit
01:00:37 AM 667612 363068 35.23 55968 119224 575564 18.60
01:00:39 AM 667612 363068 35.23 55968 119224 575564 18.60
01:00:41 AM 667612 363068 35.23 55968 119224 575564 18.60
01:00:43 AM 667612 363068 35.23 55968 119224 575564 18.60
average:667612 363068 35.23 55968 119224 575564 18.60
Kbmemfree: Because this value is basically the same as the free value in the command, it does not include buffer and cache space
Kbmemused: Because this value and the used value in the free command have been basic, it includes buffer and cache space
%memused: This value is the percentage of Kbmemfree and total memory (excluding swap)
Kbbuffers and kbcached: These two values are the buffer and cache in the free command
Kbcommit: Ensure that the current system requires memory (RAM+SWAP) in order to ensure that it does not overflow.
%commit: This value is a percentage of kbcommit and total memory (inclusive swap)

SAR Monitoring Memory Paging
[Email protected]/]# Sar-b 2 1
Linux 2.6.32-358.el6.i686 (Test1) 03/27/2015 _i686_ (1 CPU)

01:30:59 AM pgpgin/s pgpgout/s fault/s majflt/s pgfree/s pgscank/s pgscand/s pgsteal/s%vmeff
01:31:01 AM 0.00 0.00 18.59 0.00 53.77 0.00 0.00 0.00 0.00
average:0.00 0.00 18.59 0.00 53.77 0.00 0.00 0.00 0.00
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 (Major+minor)
MAJFLT/S: Number of main pages generated per second

SAR monitoring I/O rate
[Email protected]/]# Sar-b 2 1
Linux 2.6.32-358.el6.i686 (Test1) 03/27/2015 _i686_ (1 CPU)

01:37:45 AM TPs Rtps Wtps bread/s bwrtn/s
01:37:47 AM 0.00 0.00 0.00 0.00 0.00
average:0.00 0.00 0.00 0.00 0.00
TPS: Total I/O transfers per second for physical devices
Rtps: Total amount of data read from physical devices per second
Wtps: Total amount of data written per second from physical devices
BREAD/S: The amount of data read from the physical device per second, in blocks/s
BWRTN/S: Amount of data written per second from physical device, in blocks/s

SAR-Q 3 2 Monitor Queue Length and system average load
[Email protected]/]# SAR-Q 3 2
Linux 2.6.32-358.el6.i686 (Test1) 03/27/2015 _i686_ (1 CPU)

01:47:55 AM runq-sz plist-sz ldavg-1 ldavg-5 ldavg-15
01:47:58 AM 0 191 0.00 0.00 0.00
01:48:01 AM 0 191 0.00 0.00 0.00
Average:0 191 0.00 0.00 0.00
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
Ldave-l: System average load of the last 1min
Ldave-5: System average load of the last 5min
LDAVE-L5: System average load of the last 15min

SAR-W 3 2 Monitoring Exchange page information
[Email protected]/]# SAR-W 3 2
]linux 2.6.32-358.el6.i686 (Test1) 03/27/2015 _i686_ (1 CPU)

01:55:24 AM pswpin/s pswpout/s
01:55:27 AM 0.00 0.00
01:55:30 AM 0.00 0.00
average:0.00 0.00
PSWPIN/S: Number of swap pages (Swao page) swapped in system per second
PSWPOUT/S: Number of swap pages per second system swapped out

SAR-D 3 2-p Monitoring equipment usage
TPS: Number of times per second from physical disk I/O, multiple logical requests are merged into one request I/O disk, 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, from the request disk operation to the system completion process
SVCTM: The average time 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
To determine system bottlenecks, it is sometimes necessary to combine several SAR command options.
Suspected CPU bottleneck, can be used sar-u and sar-q
Suspected memory bottlenecks, Sar-b Sar-r and Sar-w
Suspect I/O has a bottleneck, sar-b sar-u sar-d


[Email protected] logs]# sar-h
Usage: SAR [options] [< time interval > [< times >]]
Main options and reports:
-B I/O and transfer rate information status
-B Paging condition
-D Block Device status
-I {< interrupts > | SUM | All | Xall}
Interrupt Information Status
-M power Management information status
-N {< keywords > [,...] | All}
Network statistics information
The key words can be:
DEV NIC
Edev NIC (Error)
NFS NFS Client
NFSD NFS Server
SOCK Sockets (socket) (v4)
IP IP Stream (v4)
EIP IP Stream (v4) (Error)
ICMP ICMP stream (v4)
EICMP ICMP Stream (v4) (Error)
TCP TCP Stream (v4)
ETCP TCP Stream (v4) (Error)
UDP UDP Streaming (v4)
SOCK6 Sockets (socket) (V6)
IP6 IP Stream (V6)
EIP6 IP Stream (V6) (Error)
ICMP6 ICMP Stream (V6)
EICMP6 ICMP Stream (V6) (Error)
UDP6 UDP Stream (V6)
-Q Queue Length and average load
-R Memory Utilization
-R Memory Status
-S Swap space utilization
-U [All]
CPU Utilization
-V Kernel Table condition
-W Task creation and system conversion statistics
-W Exchange information
-Y TTY Device status

This article is from the "surveillance Commands for SAR" blog, so be sure to keep this source http://rainbow9912.blog.51cto.com/9070528/1637554

Linux:sar 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.