Installing iostat in CentOS

&> How to install iostat using Yum
how to install sysstat using Yum
#yum install sysstat

the installation package of sysstat is: sysstat-5.0.5-1.i386.rpm, after installing sysstat-5.0.5-1.i386.rpm
there will be functions of iostat, mpstat, SAR and SA, sysstat-5.0.5-1.i386.rpm

start sysstat
/etc/init. D/sysstat start

set sysstat auto start
# Sysstat on

mpstat
mpstat – P all 2 3

mpstat is the abbreviation of multiprocessor statistics, which is a real-time system monitoring tool. It reports some statistical information about CPU, which is stored in/proc/STAT file. In the multi CPUs system, it can not only view the average status information of all CPUs, but also view the information of specific CPUs. The syntax of mpstat is as follows:
mpstat [- P {all}] [internal [count]]
the meaning of the parameter is as follows:
parameter explanation
– P {all} indicates which CPU to monitor, and the CPU is in [0, Count can only be used with delay
when there is no parameter, mpstat displays the average value of all information after the system is started. When there is an interval, the average information of the first line since the system started. Starting from the second line, the output is the average information of the previous interval. The meaning of output related to CPU is as follows:
parameter explanation: get data from/proc/STAT
CPU processor ID
user in internal time period, CPU time (%) in user mode, excluding nice value, which is negative process?Usr /?Total * 100
nice in internal time period, nice value is negative process’s CPU time (%)?Nice /?Total * 100
system In the internal time period, core time (%?System /?Total * 100
iowait in the internal time period, hard disk IO waiting time (%?Iowait /?Total * 100
IRQ in the internal time period, soft interrupt time (%?IRQ /?Total * 100
soft in the internal time period, soft interrupt time (%?Softirq /?Total * 100
idle In internal time period, the idle time (%) of CPU for any reason except waiting for disk IO operation. Idle time (%)?Idle /?Total * 100
intr/s in internal time period, the number of interrupts received by CPU per second?Intr /?Total * 100
the total working time of CPU = total_ cur=user+system+nice+idle+iowait+irq+softirq
total_ pre=pre_ user+ pre_ system+ pre_ nice+ pre_ idle+ pre_ iowait+ pre_ irq+ pre_ softirq
?user=user_ cur – user_ pre
?total=total_ cur-total_ Pre
where_ Cur is the current value_ Pre is the value before the interval time. All values in the above table can be taken to two decimal places.
Cat/proc/STAT
“ctxt” gives the number of context exchanges that have occurred since the system started.
“Btime” gives the time, in seconds, from the start of the system until now.
“processes (total_ Forks) the number of tasks created since the system was started.
“procs_ Running: the number of tasks currently running the queue.
“procs_ Blocked: the number of tasks currently blocked.

============================
the main command provided by sysstat Toolkit: iostat mpstat SAR
the last two parameters of SAR are interval count
1 and SAR – U 15
to output the statistical information of CPU usage, once per second, 100 times in total
17:06:01 CPU% user% nice% system% iowait% idle
17:06:02 all 1.270.00 0.51 1.01 97.22
17:06:03 all 0.00 0.00 0.00 100.00
17:06:04 all 0.00 0.00 0.00 100.00
17:06:05 all 0.25 0.00 0.00 0.00 99.75
17:06:06 all 0.00 0.00 0.00 0.51 99.49
average: all 0.30 0.00 0.10 0.30 99.29
CPU all indicates that the statistical information is the average value of all CPUs.
%User displays the percentage of the total CPU time spent running at the user level (application).
%Nice is displayed at the user level as a percentage of the total CPU time used for nice operations.
%The percentage of total CPU time used by the system to run at the kernel level.
%Iowait displays the percentage of total CPU time spent waiting for I/O operations.
%The percentage of virtual CPUs waiting for the service of another virtual process by the steam hypervisor.
%Idle shows the percentage of CPU idle time in total CPU time.
Tips:
if the value of% iowait is too high, it indicates that there is an I/O bottleneck in the hard disk.
if the value of% idle is high, but the system response is slow, it may be that the CPU is waiting to allocate memory, and the memory capacity should be increased at this time.
if the value of% idle continues to be lower than 10, the CPU processing capacity of the system is relatively low, indicating that the CPU is the most important resource in the system.
2. Sar-b 15
displays I/O and transmission rate statistics
17:09:07 TPS rtps WTPS bread/s bwrtn/s
17:09:08 3.123.120.00 25.00 0.00
17:09:09 89.58 6.25 83.33 141.67 733.33
17:09:10 42.71 9.38 33 141.67 600.00
17:09:11 2.11 0.00 16.84 0.00
17:09:12 1.04 0.00 1.04 0.00 175.00
average: 27.77 4.18 23.59 65.14 302.30
TPS total I/O transmission per second of physical device
total data read from physical device per second of rtps
total data written to physical device per second of WTPS
read/s total data read from physical device per second, unit: block/s
bwrtn/S The amount of data written to physical devices per second, in blocks/s
3, SAR – C
the number of processes created per second
15:10:01 s 1.35
15:20:01 s 1.01
15:30:01 s 0.59
15:40:01 s 1.35
15:50:01 s 0.99
16:00:01 s 0.57
16:10:01 s 1.33
16:20:01 s 1.02
16:30:01 s 0.57
16:40:01 second 1.33
16:50:01 second 1.07
17:00:01 second 0.56
17:10:01 second 1.32
4, sar-n dev 1.5
output statistical information of network device status
17:13:42 second Iface rxpck/s txpck/s rxbyt/s rxcmp/s txcmp/S rxmcst/s
17:13:43 second eth1 3669.70 4156.57 368362.63 2747714.14 0.00 0.00 0.00
17:13:44 eth1 2689.11 2585.15 289661.39 701461.39 0.00 0.00 0.00
17:13:45 eth1 3746.00 4077.00 415178.00 2605720.00 0.00 0.00 0.00
17:13:46 eth1 3096.00 3241.00 327916.00 1597320.00 0.00 0 0.00 0
17:13:47 eth1 2910.00 2834.00 312632.00 957903.00 0.00 0.00 0.00 0
average: eth1 3220.20 3375.60 342592.60 1717931.20 0.00 0.00 0.00
Iface network device name
rxpck/s total number of packets received per second
txpck/s total number of packets transmitted per second
rxbyt/s total number of bytes received per second
txbyt/s total number of bytes transmitted per second
rxcmp/s total number of compressed packets received per second
txcmp/S Total number of compressed packets transmitted per second
total number of multicast packets received per second
5, sar-q 15
output process queue length and average load status statistics
17:16:28, runq-sz plist-sz ldavg-1 ldavg-5 ldavg-15
17:16:29, 0 160 0.26 0.11 0.03
17:16:30, 0 160 0.26 0.11 0.03
17:16:31 0 160 0.24 0.11 0.03
17:16:32 0 160 0.24 0.11 0.03
17:16:33 0 160 0.24 0.11 0.03
average: 0 160 0.25 0.11 0.03
length of runq SZ queue (number of processes waiting to run)
number of processes and threads in plist SZ process list
ldavg-1 System load average in the last minute
ldavg-5 system load average in the past 5 minutes
ldavg-15 system load average in the past 15 minutes
6, SAR – R
output statistics of memory and switching space
7, iostat
total I/O transmission of physical devices per second.
Blk_ Read the total amount of data read in, in blocks.
Blk_ The total amount of data written by wrtn, in blocks.
kB_ Read the total amount of data read in, in kilobytes.
kB_ The total amount of data written by wrtn, in kilobytes.
MB_ Read the total amount of data read in, in MB.
MB_ The total amount of data written by wrtn, in MB.
Blk_ Read/s the amount of data read from the drive per second, in blocks/s.
Blk_ Wrtn/s the amount of data written to the drive per second, in blocks/s.
kB_ The amount of data read in from the drive is KB/s.
kB_ Wrtn/s the amount of data written to the drive per second, in KB/s.
MB_ Read/s the amount of data read from the drive per second, in MB/s.
MB_ Wrtn/s the amount of data written to the drive per second, in MB/s.
The number of read requests sent to the device per second after rrqm/s merges the read requests.
The number of write requests sent to the device per second after wrqm/s merges the write requests.
R/s the number of read in requests sent to the device per second.
W/s the number of write requests sent to the device per second.
RSEC/s the number of sectors read from the device per second.
The number of sectors wsec/s writes to the device per second.
RKB/s the amount of data read from the device per second, in KB/s.
The amount of data written to the device in KB/s per second.
RMB/s the amount of data read from the device per second, in MB/s.
WMB/s the amount of data written to the device per second, in MB/s.
The average size of avgrq SZ requests sent to the device, in sectors.
Avgqu SZ is the average queue length of requests sent to the device.
Average execution time of await I/O requests. This includes the time to send the request and execute it. The unit is milliseconds.
The average execution time of I/O requests sent by svctm to the device. The unit is milliseconds.
%Util is the percentage of CPU time that I/O requests are sent to the device. Used to display the bandwidth utilization of the device. When this value is close to 100%, it means that the device bandwidth is full.

There is a performance problem in the Linux system. Generally, we can check the initial positioning problem through the top, iostat, free, vmstat and other commands. Iostat can provide us with abundant IO status data.

1.

Similar Posts: