Content Summary:
Monitoring System Status –w, Vmstat
Command W, uptime
System load averages the number of processes active during the unit time period
View the number of CPUs and the number of cores
Vmstat 1
Vmstat 1 10
Vmstat the meaning of each indicator:
R: Indicates the number of processes running and waiting for CPU time slices, if the long-term is greater than the number of server CPUs, it indicates that the CPU is not enough;
B: Indicates the number of processes waiting for a resource, such as waiting for I/O, memory, and so on, if the value of this column is greater than 1 for a long time, then you need to look at
Si: The amount of memory entered by the switching zone;
So: the number of memory into the swap area;
BI: The amount of data read from a block device (read disk);
Bo: The amount of data written from a block device (write disk);
In: Number of interrupts per second, including clock interrupts;
CS: The number of context switches per second;
WA: Represents the percentage of CPU time consumed by I/O waits.
Monitoring System Status –top
The system resources used for dynamic monitoring processes change every 3 seconds.
RES This is the amount of memory that the process occupies, and%MEM is the percentage of memory used. In the top state, press SHIFT + M to sort by memory usage size. Press the number ' 1 ' to list the usage status of each CPU.
TOP-BN1 it represents the use of non-dynamic printing system resources, which can be used in shell scripts
Top-c the right-most command to display more detailed information
Monitoring System Status –sar
Without this command, use Yum install-y sysstat
The following error is prompted when installing the first execute #sar command.
Cannot open/var/log/sa/sa**: No such file or directory
The asterisk value is usually the date of the day.
This error is caused by not creating the file, but using the parameter-o to generate it.
#sar-O 2 7
So there will be files in the/var/log/sa/directory.
Network card traffic Sar-n Dev, sar-n Dev 1 10
Sar-n dev-f/var/log/sa/sa24
View Historical Load Sar-q
View disk read-write Sar-b
Monitor network card traffic
Ifstat
Iftop
Free to view system memory usage
Free Displays the-m in units K in units of-G in units of
MEM (total): Number of memory; MEM (used): already allocated memory; Mem (free): unallocated memory; MEM (Buffers): a system-assigned but unused cache of Buffers;mem (cached) systems allocated but not used
Buffers/cache (used): actual use of buffers and cache total, but also the actual use of memory, Buffers/cache (free): unused buffers and cache and unallocated memory of the sum, This is the current actual memory available to the system
The buffers is about to be written to the disk, and the cache is read from the disk.
PS View System process
PS aux/ps-elf
PID: The ID of the process, this ID is very useful, in Linux kernel management process relies on PID to identify and manage a certain process, such as I want to terminate a certain processes, the ' kill process pid ' sometimes do not kill, you need to add a-9 option
KILL-9 Process PID
STAT: Indicates the status of the process, and the process state is divided into the following
D a process that cannot be interrupted (usually IO)
R Running Process
S has been interrupted, and most of the process in the system is this state
T has stopped or paused the process, if we are running a command, say sleep 10 if we press Ctrl-z to let him pause, then we will show the status of T in PS view
X already dead process (this never appears)
Z zombie process, can't kill, fight the garbage process, the system a small resource, but no relationship. If too many, there is a problem. Kill Kills
< high-priority processes
N Low-priority processes
L was locked in memory paging
S master Process
L Multithreading Process
+ Process in the foreground
Pstree Tree Show All Processes
Netstat viewing network conditions
NETSTAT-LNP View current system-enabled ports and sockets
Netstat-an View all connections to the current system
Extended Knowledge:
1. Process Priority https://www.ibm.com/developerworks/cn/linux/l-lpic1-v3-103-6/
2. Linux Process priority Tuning http://blog.csdn.net/blade2001/article/details/41944589
3. TCP three-time handshake and four wave http://www.vimer.cn/2009/11/%E7% ... Af%a6%e8%a7%a3.html
4. View CPU Usage Mpstat http://www.aminglinux.com/bbs/thread-7180-1-1.html
5. Hard interrupt and soft interrupt http://noican.blog.51cto.com/4081966/1361087
6. CPU Context Switch http://iamzhongyong.iteye.com/blog/1895728
7. Linux important performance Indicators-CPU http://www.taobaotest.com/blogs/2355
8. Dstat tool usage (without this command yum install Dstat installation) http://www.cnblogs.com/vincent-hv/p/3358194.html
9. Linux Disk IO monitoring tool iotop https://www.centos.bz/2013/01/io-monitor-iotop/
Linux real-time priority, non-real-time priority http://www.aminglinux.com/bbs/thread-7774-1-1.html
11. View CPU Cores http://www.aminglinux.com/bbs/thread-7784-1-1.html
2015-04-15 Linux system daily management 1