Use of Linux sar commands

Source: Internet
Author: User


Use of Linux sar commands 1. Common sar command line formats: sar [options] [-A] [-o file] t [n] in the command line, the n and t parameters are combined to define the sampling interval and number of times. t indicates the sampling interval, which is a required parameter. n indicates the number of samples and is optional. The default value is 1, -o file: stores command results in binary format. file is not a keyword but a file name. Options is the command line option, and there are many options for sar commands. The following lists only common options: www.2cto.com-A: total of all reports. -U: CPU usage-v: process, I node, file, and lock table status. -D: hard disk usage report. -R: Memory pages and hard disk blocks that are not in use. -G: serial port I/O. -B: Buffer usage. -A: file read/write status. -C: System Call status. -R: Process activity. -Y: terminal device activity. -W: system exchange activity. Ii. Empirical Analysis Steps: www.2cto.com first checks the CPU usage and operates according to the instructions for diagnosing the CPU, memory, or disk bottleneck. For each of the following steps, find the trend at one end and collect data with poor system performance. In addition, accurate diagnosis can be performed only when the data is compared with the data collected during normal operation of the system. Step 1 # sar-u [interval] [iterations] (example: sar-u 5 30) % is the idle low? This is the percentage of time when the CPU is not running any process. % Idle zero at one end of time may be the first indication of CPU bottleneck. No-> there is no CPU bottleneck in the system. Go to step 3. Yes-> the system may experience CPU, memory, or I/O bottlenecks. Go to step 2. Does www.2cto.com step 2% usr be relatively high? Many systems normally spend 80% of the CPU time for users and 20% for the system. Other systems usually use around 80% of user time. No-> the system may encounter CPU, memory, or I/O bottlenecks. Go to step 3. Yes-> the system may encounter CPU bottlenecks due to user processes. Adjust the CPU bottleneck of the system. In step 3%, is the wio value greater than 15? (Different operating systems have different thresholds) www.2cto.com is-> remember this value later. It may indicate disk or tape bottlenecks. Go to step 4. No-> go to step 4. Step 4 # sar-d [interval] [iterations] is the % busy used on any disk greater than 50? (Remember, 50% indicates an approximate guide, which may be much higher than the normal value of your system. In some systems, even a % busy value of 20 may indicate a disk bottleneck, while other systems may be 50% busy normally .) Is avwait greater than avserv on the same disk? No-> it is probably not a disk bottleneck. Go to Step 6. Yes-> This device seems to have encountered an I/O bottleneck. Go to Step 5. Step 5. What are the disk bottlenecks on www.2cto.com? Original partition, file system-> adjust the system where the disk IO bottleneck occurs. Swap-> may be caused by memory bottleneck. Go to Step 6. Step 6 # vmstat [interval] [iterations] during a long period of time, is the po always greater than 0? For an s800 System (free * 4 k) is less than 2 MB (for an s700 system free * 4 k is less than 1 MB )?
(2 MB and 1 MB indicate the approximate guide. The true LOTSFREE value is calculated when the system starts paging, it is based on the system memory size .) Www.2cto.com is not-> If % idle in step 1 is low, the system may encounter a CPU bottleneck and adjust the system with a CPU bottleneck. If % idle is not very low, it may not be the CPU, disk I/O, or memory bottleneck. Yes-> there is a memory bottleneck in the system. Adjust the system in which the memory bottleneck occurs.

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.