CentOS view the CPU, memory, network traffic, and disk I / O

CentOS view the CPU, memory, network traffic, and disk I / O

Installation yum install -y sysstat

sar -d 1 1

rrqm / s: the number of read operations performed per second merge. I.e. Delta (rmerge) / S
wrqm / S: merge number of write operations performed per second. I.e. Delta (wmerge) / S
R & lt / S: second reading completion of I / O devices. I.e. Delta (Rio) / S
W / S: second write completion of I / O devices. I.e. Delta (wio) / S
Rsec / S: Read the number of sectors per second. I.e. Delta (rsect) / S
Wsec / S: write the number of sectors per second. I.e. Delta (wsect) / S
rkB / S: K bytes per second read. It is half rsect / s, as each sector size is 512 bytes. (Calculated required)
WKB / S: K bytes per write. It is wsect half / s. (Calculated required)
avgrq-SZ: the average size of the device each data I / O operations (sector). Delta (rsect wsect +) / Delta (Rio + wio)
avgqu-SZ: average I / O queue length. I.e., delta (aveq) / s / 1000 ( because of AVEQ milliseconds).
await: Average waiting time per device I / O operations (in milliseconds). I.e. Delta (Ruse Wuse +) / Delta (Rio + wio)
the svctm: Average per-device I / O operations service time (in milliseconds). I.e. Delta (use) / Delta (Rio + wio)
% util: one second how many percent of the time for I / O operations, or how much time is one second I / O queue is not empty. I.e., delta (use) / s / 1000 ( use because the unit is ms)

If% util close to 100%, indicating that the generated I / O requests too, I / O system has been at full capacity, the disk
may be a bottleneck.
idle less than 70% IO pressure on the larger, and generally have more speed reading wait.
At the same time can be combined with vmstat View View b parameters (number of processes waiting for resources) and wa parameter (IO wait for the percentage of CPU time, IO when high pressure higher than 30%)

Also refer
svctm generally less than await (because the wait time while waiting for a repeated request is calculated), the size and general svctm disk performance related, CPU / memory load will affect them, too many requests will indirectly lead to an increase of svctm. await service time generally depends on the size (the svctm) and I / O queue length and I / O pattern issued the request. If svctm await close, for I / O almost no wait time; much greater than if await svctm, illustrate the response time of I / O queue is too long, resulting in slower application, if the user response time exceeds the permissible range, then you can consider replacing faster disk, adjust elevator core algorithm, optimized applications, or upgrade CPU.
Queue length (avgqu-sz) may also be used as indicators to measure the system I / O load, but the avgqu-sz unit of time in accordance with the average value, it can not reflect the instantaneous I / O flood.

In the command line, how to view CPU, memory usage, network traffic, and disk I / O?

Q: In the command line, how to view CPU, memory usage, network traffic, and disk I / O?

A: A command line,

1. Check the CPU usage command

$ vmstat 5

Refresh every five seconds, the far right of the data occupancy rate of the CPU

$ top

top and then press Shift + P, in accordance with the sorting process CPU usage

2. Check the memory usage of the command

$ free

top and then press Shift + M, in accordance with the sorting process memory usage

$ top

3. Check network traffic

Tools can use tools iptraf

$ iptraf -g

"" For an Interface network traffic can be obtained by RX and TX data comparing the two time network interfaces

$ date; ifconfig eth1

$ date; ifconfig eth1

4. Check Disk i / o

$ iostat -d -x /dev/sdc3 2

View Disk / dev / sdc3 with iostat disk i / o, the refresh every two seconds

$ vmstat 2

Io section view information with vmstat

procs:
R->; the number of waiting in the run queue process
b->; io the number of waiting processes
w->; run queue but can be replaced into the process

memoy
swap->; swap memory available at present (k shown)
Free->; free memory (k represented)

Pages and the
RE - "recovery page
mf--" non-critical error page
pi-- "to enter the page number (k expressed)
po -" the number of pages (k expressed)
fr-- "spare page number (k denote )
de-- in "misses read ahead into the page
sr--" pages scanned by clock algorithm

disk show disk operations per second. s represents scsi disc, disc number 0 represents

fault display of the number of interrupts per second
in-- "device interrupts
sy--" system interruption
cy - "cpu exchange

cpu cpu usage represents the state
cs-- "time user processes
sy--" system time used by the process
id - "cpu idle time

Wherein:
if r often greater than 4, often less than 40 and id, denotes the cpu load is heavy.
If pi, po long periods equal to 0, indicating insufficient memory.
If the disk is often not equal to 0, and b is in the queue is greater than 3, io represents poor performance.

This switched not more than 24 characters blog 51CTO blog, description link http://blog.51cto.com/cstsncv/1926475 For reprint please contact the original author yourself

cstsncv

Guess you like

Origin www.cnblogs.com/h-gallop/p/11646111.html