Linux Learning Summary (22) System management skills

Source: Internet
Author: User
Tags sorts cpu usage disk usage

1 Command W to view the system load:


user-logged in User name
tty-system-assigned terminal number after login
from-remote host name, where to log in from
login-when to log in
How long the idle-is idle, indicating when the user is idle. This is a timer that will be reset once the user performs any action
The time taken by all processes jcpu-and the terminal (TTY) connection, which does not include the past background job time, but includes the time occupied by the currently running background job
Pcpu-refers to the time taken by the current process (that is, the process displayed in the What item)
what-the command line that is currently running the process
The above content is only for understanding, we focus on
Load average This column, the following three numbers mean:
The first value represents the average load value of the system within 1 minutes, the second value represents the average load value of the system within 5 minutes, and the third value represents the average load value of the 15-minute system. Its specific meaning is the number of CPU active processes per unit of time, the larger the value, the heavier the CPU load. Usually we have to judge by the number of logical CPUs,
cat /proc/cpuinfo |grep ‘process‘

A processor represents a logical CPU, numbering starts from 0 and ranks backwards. We focus on the 1-minute average load value if the value exceeds
Logical CPU count, be aware that you want to further troubleshoot whether an exception process consumes CPU resources.

2 Command Vmstat Monitor system status


We'll read it all by item
1) procs Display process-related information
R: Indicates the number of processes running and waiting for CPU time slices, if the value is longer than the number of CPUs, it means that the CPU is not enough
B: Indicates the number of processes waiting for the resource, such as waiting for memory, I/O, etc., the value is longer than 1, need attention.
2) Meory Memory related information
SWPD: Indicates the amount of memory switched to the swap partition
Buff: Buffer size (about to be written to disk)
Cache: Buffer size (read from disk)
3) Swap Memory exchange situation
Si: The number of writes to memory by the swap area
So: The number of writes to the swap area by memory
4) IO disk usage
BI: The amount of data read from disk
Bo: The amount of data written to disk
5) system shows the number of interrupts occurring during the acquisition interval
In: Indicates the number of device interrupts per second observed at a certain time interval;
CS: Indicates the number of context switches produced per second
6) Usage of CPU
US: Shows the percentage of CPU time that is spent under the user
Sy: Displays the percentage of CPU time that the system spends;
ID: The percentage of time that the CPU is idle;
WA: Indicates the percentage of CPU time consumed by I/O waits;
We focus on: r,b.wa,bi,bo,si,so these columns
We usually use the Vmstat 1 5, which means that every second output state, output 5 times

3 Top command

Display the system resources that the process occupies

The top command dynamically monitors how each process consumes system resources, changing every three seconds.
Tasks Process Number
RES This column represents the amount of memory the process occupies
We focus on the three columns of%cpu%MEM and COMMAND
Related actions in top
M: Sorts based on the size of the resident memory.
P: Sorts according to the percentage size of CPU usage.
T: Sort by Time/cumulative time.
1: Can toggle display of all CPU usage status
Q: Exit Top
TOP-BN1 output all information at once, static display
SAR command Monitors system Status

4 SAR

It can monitor all the resource status of the system, we mainly use it to monitor the network card.
1 Viewing network card traffic
Sar-n DEV

This command prints the network card information that was recorded on the day, and records it every 10 minutes.
IFACE indicates the NIC name
RXPCK/S number of packets received per second
TXPCK/S number of packets sent per second
rxkb/s amount of data received per second
txkb/s amount of data sent per second
If RXPCK/S is greater than 4000 or rxkb/s is greater than 5G, be aware that you are being attacked by malicious intent.
We can also view real-time
sar -n DEV 1 5
You can also view the network card traffic history for a given day by looking at the log
sar -n DEV -f /var/log/sa/sa23

5 nload command Cards card card network traffic

nload command to view network card traffic is more intuitive than SAR commands. The command installation method
yum install -y epel-release ; yum install -y nload

Execute the nload command to get results, the top line is the network card name and IP address, press the right arrow can switch other network cards, the output is divided into two parts, Incoming to enter the network card traffic, outgoing for the network card out of traffic, we are concerned about
Curr that line, press Q to exit.

Linux Learning Summary (22) System management skills

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.