Install Yum install-y sysstat
Sar-d 1 1
RRQM/S: The number of read operations per second for the merge. Delta (rmerge)/s
wrqm/s: The number of write operations per second for the merge. Delta (wmerge)/s
r/s: Number of Read I/O devices completed per second. Delta (RIO)/s
w/s: Number of write I/O devices completed per second. Delta (WIO)/s
rsec/s: Number of Read sectors per second. Delta (rsect)/s
wsec/s: Number of Write sectors per second. That is, Delta (wsect)/s
rkb/s: reads K bytes per second. is half the rsect/s because the size of each sector is 512 bytes. (Calculation required)
WKB/S: Writes the number of K bytes per second. is half the wsect/s. (Calculation required)
Avgrq-sz: The average data size (sector) for each device I/O operation. Delta (rsect+wsect)/delta (rio+wio)
Avgqu-sz: Average I/O queue length. That is Delta (AVEQ)/s/1000 (because the Aveq is in milliseconds).
await: The average wait time (in milliseconds) per device I/O operation. Delta (ruse+wuse)/delta (rio+wio)
SVCTM: The average service time (in milliseconds) per device I/O operation. That is, Delta (use)/delta (rio+wio)
%util: How much time in a second is spent on I/O operations, or how many times in a second I/O queues are non-empty. That is, the delta (use)/s/1000 (because the use is in milliseconds)
If%util is close to 100%, it indicates that there are too many I/O requests, the I/O system is full, and the disk may have bottlenecks.
Idle less than 70% io pressure is larger, the general reading speed has more wait.
You can also combine vmstat to see the b parameter (the number of processes waiting for a resource) and the WA parameter (the percentage of CPU time that IO waits for, higher than 30% when the IO pressure is high)
In addition, you can also refer
SVCTM generally less than await (because the waiting time for waiting requests is repeatedly computed), the size of SVCTM is generally related to disk performance, cpu/memory load will have an impact on it, too many requests will indirectly lead to increased SVCTM. The size of an await typically depends on the service time (SVCTM) and the length of the I/O queue and the emit mode of the I/O request. If the SVCTM is closer to await, stating that I/O has almost no waiting time, if the await is much larger than SVCTM, the I/O queue is too long, the response time of the application gets slower, and if the response time exceeds the allowable range of the user, consider replacing the faster disk and adjusting the kernel Elev Ator algorithm, optimize the application, or upgrade the CPU.
The queue Length (AVGQU-SZ) can also be used as an indicator for measuring the system I/O load, but because Avgqu-sz is averaged over a unit time, it does not reflect instantaneous I/O flooding.
How do I see CPU, Memory usage, network traffic, and disk I/O in command line mode?
Q: How can I view CPU, memory usage, network traffic and disk I/O in command line mode?
A: In the command line mode,
1. Commands to view CPU usage
$ vmstat 5
Refreshes every 5 seconds with data on the right-most CPU occupancy
$ top
Top then press Shift+p to sort by process processor occupancy
2. Commands to view memory usage
$ free
Top and then press Shift+m to sort by process memory usage
$ top
3. View network traffic
Yum-y Install Iptraf
You can use tools Iptraf tools
$ iptraf-g
"The network traffic for a interface can be obtained by comparing the RX and TX data of two time network interfaces
$ date; Ifconfig eth1
$ date; Ifconfig eth1
4. View disk I/O
$ iostat-d-X/DEV/SDC3 2
Use Iostat to see disk I/O for disk/DEV/SDC3, refreshed every two seconds
$ vmstat 2
View the IO section information with Vmstat
Procs:
r–>; number of processes waiting in the run queue
b–>; number of processes waiting on Io
w–>; can enter a process that runs the queue but is replaced
Memoy
swap–>; currently available swap memory (k)
free–>; idle memory (k)
Pages
re--"Recycled pages
mf--"Not a serious error page
pi--"Number of pages entered (k)
po--"Number of pages out (k)
fr--"Number of free pages (k)
de--the number of misses in the page that was read in advance
sr--"page scanned by the clock algorithm
Disk displays the disks operation per second. s indicates a SCSI disk, 0 indicates the disk number
Fault display of interrupts per second
in--"Device interrupted
sy--"System Interrupt
cy--"CPU Switching
CPU indicates usage status of CPU
cs--"User Process usage time
sy--"Time the system process was used
id--"CPU Idle Time
which
If R is often greater than 4 and the ID is often less than 40, it indicates that the CPU is heavily loaded.
If the Pi,po is not equal to 0 for a long time, it indicates insufficient memory.
If disk is often not equal to 0, and the queue in B is greater than 3, the IO performance is poor.
CentOS view CPU, memory, network traffic, and disk I/O