Use sysstat for Centos Installation

Source: Internet
Author: User

Sysstat

Install with yum
# Yum install sysstat

Sysstat installation package is: sysstat-5.0.5-1.i386.rpm, installed sysstat-5.0.5-1.i386.rpm
Then there will be iostat, mpstat, sar, sa function, sysstat-5.0.5-1.i386.rpm

Start sysstat
/Etc/init. d/sysstat start

Set sysstat to start automatically
# Checkfig sysstat on

MPSTATMPSTAT-p all 2 3mpstat is short for Multiprocessor Statistics and is a real-time system monitoring tool. Its report and CPU statistics are stored in the/proc/stat file. In a multi-CPUs system, it can not only view the average status information of all CPUs, but also view the information of specific CPUs. The following describes only the CPU-related parameters of mpstat. the syntax of mpstat is as follows: mpstat [-P {| ALL}] [internal [count] has the following meanings: parameter description-P {| ALL} indicates the CPU to be monitored. The interval between two adjacent sampling times of internal in [0, cpu count-1] is count the number of sampling times, count can only be used with delay. If there is no parameter, mpstat displays the average value of all information after the system starts. When interval exists, the average information of the first line since the system was started. From the second line, the output is the average information of the previous interval period. The meanings of CPU-related output are as follows: the parameter explanation obtains the user-state CPU time (%) of the IDuser of the Data CPU processor from/proc/stat during the internal period ), the nice value does not include the negative process worker usr/worker total * 100 nice in the internal period, and the nice value is the CPU time of the negative process (%) too nice/too total * 100 system in the internal period, core time (%) Too system/too total * 100 iowait in the internal period, hard disk IO wait time (%)  iowait/ total * 100irq in the internal period, soft Interrupt time (%)  irq/semi total * 100 soft in the internal period, soft Interrupt time (%) when softirq/ total * 100 idle is in the internal period, the CPU is idle for any reason except waiting for disk I/O operations (%) Incluidle/inclutotal * 100 intr/s during the internal period, number of CPU interruptions received per second (total intr/clock total * 100CPU total working hours) = total_cur = user + system + nice + idle + iowait + irq + softirqtotal_pre = pre_user + pre_system + pre_nice + pre_idle + pre_iowait + pre_irq + pre_softirq ready user = user_cur-user_pre ready total = total_cur-total_pre where _ cur represents the current value, _ pre indicates the value before the interval time. All values in the preceding table can be two decimal places. Cat/proc/stat "ctxt" indicates the number of times the CPU context switches have occurred since the system was started. "Btime" indicates the time (in seconds) that has elapsed since the system was started. The number of tasks created since the system started "processes (total_forks. "Procs_running": number of tasks in the current queue. "Procs_blocked": Number of blocked tasks. ============================ Main Commands provided by the sysstat Toolkit: the last two parameters of iostat mpstat sarsar are generally interval count1 and sar-u 1 5.
CPU usage statistics are output once per second. A total of 100 CPU usage statistics are output.
17: 06 minutes 01 seconds CPU % user % nice % system % iowait % idle
17: 06 minutes 02 seconds all 1.27 0.00 0.51 1.01 97.22
17: 06 minutes 03 seconds all 0.00 0.00 0.00 0.00 100.00
17: 06 minutes 04 seconds all 0.00 0.00 0.00 0.00 100.00
17: 06 minutes 05 seconds all 0.25 0.00 0.00 0.00 99.75
17: 06 minutes 06 seconds all 0.00 0.00 0.00 0.51 99.49
Average: all 0.30 0.00 0.10 0.30 99.29CPU all indicates that the statistical information is the Average of all CPUs.
% User shows the percentage of total CPU usage at the user level (application.
% Nice is displayed at the user level as a percentage of the total CPU usage for nice operations.
% Percentage of the total CPU usage of system at the core level (kernel.
% Iowait displays the percentage of CPU usage for waiting for I/O operations.
% Percentage of virtual CPUs waiting for the steal hypervisor to provide services for another virtual process.
% Idle shows the percentage of CPU usage in idle time. Tips:
If % iowait is too high, it indicates that the hard disk has an I/O bottleneck.
If the value of % idle is high but the system response is slow, the CPU may be waiting for memory allocation. In this case, the memory capacity should be increased.
If the value of % idle is lower than 10, the CPU processing capability of the system is relatively low, indicating that the most important resource to be solved in the system is the CPU. 2. sar-B 1 5
Displays the I/O and transfer rate statistics
17: 09 minutes 07 seconds tps rtps wtps bread/s bwrtn/s
17: 09 minutes 08 seconds 3.12 3.12 0.00 25.00 0.00
17: 09 minute 09 second 89.58 6.25 83.33 141.67 733.33
17: 09 minutes 10 seconds 42.71 9.38 33.33 141.67
17: 09 minute 11 second 2.11 2.11 0.00 16.84 0.00
17: 09 minutes 12 seconds 1.04 0.00 1.04 0.00
Average: 27.77 4.18 23.59 65.14 302.30tps I/O total volume of physical devices per second
Total amount of data that rtps reads from physical devices per second
Total data written by wtps to physical devices per second
The amount of data that bread/s reads from the physical device per second. The unit is block/s.
The data volume written by bwrtn/s to the physical device per second. The unit is block/s3 and sar-c.
Number of processes created per second
15: 10 minutes 01 seconds 1.35
15: 20 minutes 01 seconds 1.01
15: 30 minutes 01 seconds 0.59
15: 40 minutes 01 seconds 1.35
15: 50 minutes 01 seconds 0.99
16: 00 minutes 01 seconds 0.57
16: 10 minutes 01 seconds 1.33
16: 20 minutes 01 seconds 1.02
16: 30 minutes 01 seconds 0.57
16: 40 minutes 01 seconds 1.33
16: 50 minutes 01 seconds 1.07
17: 00 minutes 01 seconds 0.56
17: 10 minutes, 01 seconds, 1.324, sar-n DEV 1 5
Output network device status statistics
17: 13 minutes 42 seconds IFACE rxpck/s txpck/s rxbyt/s txbyt/s rxcmp/s txcmp/s rxmcst/s
17: 13 minutes 43 seconds eth1 3669.70 4156.57 368362.63 2747714.14 0.00 0.00 0.00
17: 13 minutes 44 seconds eth1 2689.11 2585.15 289661.39 701461.39 0.00 0.00 0.00
17: 13 minutes 45 seconds eth1 3746.00 4077.00 415178.00 2605720.00 0.00 0.00 0.00
17: 13 minutes 46 seconds eth1 3096.00 3241.00 327916.00 1597320.00 0.00 0.00 0.00
17: 13 minutes 47 seconds eth1 2910.00 2834.00 312632.00 957903.00 0.00 0.00 0.00
Average: eth1 3220.20 3375.60 342592.60 1717931.20 0.00 0.00 IFACE network device name
Total number of packages received per second by rxpck/s
Total number of txpck/s packets transmitted per second
Total number of bytes received by rxbyt/s per second
Total number of bytes transmitted per second by txbyt/s
Total number of compressed packages received per second by rxcmp/s
Total number of compressed packages transmitted per second in txcmp/s
Total number of multicast packets received by rxmcst/s per second 5. sar-q 1 5
Output process queue length and average load status statistics
17-16 min 28 sec runq-sz plist-sz ldavg-1 ldavg-5 ldavg-15
17: 16 minutes 29 seconds 0 160 0.26 0.11
17: 16 minutes 30 seconds 0 160 0.26 0.11
17: 16 minutes 31 seconds 0 160 0.24 0.11
17: 16 minutes 32 seconds 0 160 0.24 0.11
17: 16 minutes 33 seconds 0 160 0.24 0.11
Average: 0 160 0.25 0.11 0.03runq-sz running queue length (number of processes awaiting running)
Number of processes and threads in the plist-sz Process List
Average System load for the last minute of the ldavg-1 (System load average)
Average system load for ldavg-5 over the past 5 minutes
Ldavg-15 average system load over the past 15 minutes 6, sar-r
Output memory and swap space statistics
7. iostat
Tps indicates the total amount of I/O transferred by physical devices per second.
Total amount of data read by Blk_read, in blocks.
Total amount of data written by Blk_wrtn, in blocks.
The total amount of data read by kB_read, in KB.
Total data written by kB_wrtn, in KB.
The total amount of data read by MB_read, in MB.
Total data written by MB_wrtn, in MB.
The volume of data that Blk_read/s reads from the drive per second. The unit is block/s.
The volume of data written to the drive per second by Blk_wrtn/s. The unit is block/s.
KB_read/s: the amount of data read from the drive per second. Unit: KB/s.
KB_wrtn/s data volume written to the drive per second, measured in KB/s.
The data volume read from the drive per second in MB/s.
Data volume written to the drive per second in MB_wrtn/s, measured in MB/s.
The number of read requests sent to the device per second after rrqm/s merges read requests.
Number of write requests sent to the device per second after wrqm/s merges write requests.
The number of read requests sent by r/s to the device per second.
The number of write requests sent to the device per second by w/s.
The number of sectors that rsec/s reads from the device per second.
Number of sectors written to the device per second by wsec/s.
The amount of data that rkB/s reads from the device per second, measured in KB/s.
The amount of data written to the device per second by wkB/s. The unit is KB/s.
The amount of data read from the device per second in the unit of MB/s.
The amount of data written to the device per second by wmb/s. The unit is MB/s.
Avgrq-sz average size of requests sent to the device, in the unit of sector.
Avgqu-sz average queue length of requests sent to the device.
Average execution time of await I/O requests. This includes the time when the request is sent and executed. The Unit is milliseconds.
Average execution time of the I/O requests that svctm sends to the device. The Unit is milliseconds.
% Percentage of CPU time consumed when I/O requests are sent to the device. Used to display the bandwidth usage of a device. When the value is close to 100%, the bandwidth of the device is full.

Related Article

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.