w command: View system load
W
Load average the number of active processes that use CPU activity during the unit time
To view the number of system CPUs (logical CPUs)
Cat/proc/cpuinfo
(When our process does not exceed the number of logical CPUs in our system per unit of time, it is the optimal state,
When our process is larger than the CPU, be aware of what is taking up our CPU.
Vmstat Command (monitor system status) Vmstat
Vmstat 1 (dynamic display, show once per second)
Vmstat 1 5 (dynamic display, show every second, show 5 end)
R: (run) indicates the number of processes running or waiting for CPU time slices
B: (block) indicates the number of processes waiting for the resource (the process is blocked by resources other than the CPU, such as network, hard disk ...) Process is in a wait state)
swap: Not enough memory is going to put a part of the memory into swap .
Si: Indicates how many kilobytes of data are entered into memory from swap, in kilobytes
so: Indicates how many kilobytes of data are written from memory to the swap partition swap
bi: Indicates how many kilobytes of data are read from disk into memory, in kilobytes
bo: Indicates how many kilobytes of data are written from memory to disk
us: Percentage of CPU consumed in user state (percent)
sy: System Zhang Yong's CPU ratio
id: Percentage of CPU in idle state (US +sy +id =100)
WA: Indicates the percentage of I/O waiting to occupy the CPU (if the value is large enough to reflect the lack of CPU)
Top command (Displays the system resources that the process occupies)
Top command: Dynamic monitoring of the system resources of the process, three seconds to change
The load on the system can be very high, but the%cpu can be very low because the process may be waiting for a lot of CPU usage, not the process is in the running state. (%cpu is very high, the system load will be very high)
RES: The amount of memory the process occupies
%MEM: Percentage of memory used
Press the M key: show sort by memory size
Press the P key: show sort by CPU occupied size
By number 1: Lists the usage status of all nuclear CPUs 1
Press the Q key to exit top
Top-c (View the process global path)
TOP-BN1 (one-time output all information of all processes, non-dynamic display, suitable for writing scripts)
SAR (Monitoring the status of almost all resources in the system)
SAR command to add options (parameters)
(information is obtained once every 10 minutes)
(1)
Install First: Yum install-y sysstat
(2) Sar-n DEV view NIC Traffic da
Sar-n DEV 1 5 displays each second, showing 5 ends
(When RXPCK to 1w, or RXKB is large, the site may be attacked)
Sar-n dev-f/var/log/sa/saxx View Historical data (in 30 days)
Sar-n dev-f/var/log/sa/sa27 View Historical data for No. 27th
Sar-q Viewing system load
Sar-q 1 10
Sar-q-f/var/log/sa/sa27
Sar-b viewing disk reads and writes
Sar-b 1 5
Linux daily Operations Management tips: W command-View system load, vmstat command, top command, SAR command