Linux Routine Management 1. linux System Management
From: http://www.apelearn.com/bbs/forum.php? Mod = viewthread & tid = 7769 & extra = page % 3D1% 26 filter % 3 Dtypeid % 26 typeid % 3D36
Monitor System status-w, vmstat
Command w, uptime
System load averages
View the number of CPUs and cores
Vmstat 1
Vmstat 1 10
Meanings of vmstat indicators:
R: indicates the number of processes that run and wait for the cpu time slice. If the number is greater than the number of the server cpu for a long time, the cpu is insufficient;
B: indicates the number of processes waiting for resources, such as waiting for I/O and memory. If the value of this column is longer than 1, you need to pay attention to it.
Si: the number of memory entries in the SWAp zone;
So: the number of memories that enter the swap zone;
Bi: the amount of data read from Block devices (read disk );
Bo: The amount of data written from the block device (to the disk );
In: The number of interruptions per second, including clock interruptions;
Cs: the number of context switches per second;
Wa: Percentage of cpu time used by I/O wait.
Monitoring System status-top
It is used to dynamically monitor the system resources occupied by processes and change every 3 seconds.
RES indicates the memory occupied by the process, and % MEM indicates the memory usage percentage. In the top state, shift + m can be sorted by memory usage. You can use the number '1' to list the cpu usage status.
Top-bn1: indicates non-dynamic printing of system resource usage, which can be used in shell scripts.
The command on the rightmost side of top-c shows more detailed information.
Monitoring System status-sar
Without this command, use yum install-y sysstat
Nic traffic sar-n DEV, sar-n DEV 1 10
Sar-n DEV-f/var/log/sa/sa24
View historical loads sar-q
View disk read/write sar-B
Free view system memory usage
Free is displayed in the unit of k.-m is in the unit of M.-g is in the unit of G.
Mem (total): total memory; mem (used): allocated memory; mem (free): unallocated memory; mem (buffers ): buffers allocated by the system but not used; memory (cached) cache allocated by the system but not used
Buffers/cache (used): the total amount of actually used buffers and cache, which is also the actual memory used; buffers/cache (free ): the sum of unused buffers, cache, and unallocated memory, which is the actual available memory of the system.
Buffers is about to be written to the disk, and the cache is read from the disk.
Ps: View System Processes
Ps aux/ps-elf
PID: process id. This id is very useful. In linux, the kernel management process must rely on pid to identify and manage a specific process. For example, if I want to terminate a process, if the 'Kill process pid 'is used, the kill-9 process pid must be added.
STAT: indicates the status of a process. The process status is divided into the following types:
D. process that cannot be interrupted (usually I/O)
R running process
S: the process that has been interrupted. Most of the processes in the system are in this status.
T: a process that has been stopped or paused. If we are running a command, for example, sleep 10, if we press ctrl-z to suspend the process, we will display the status T in ps.
X dead processes (this will never happen)
Z botnets cannot be killed, and zombie spam processes occupy a small amount of resources in the system, but it does not matter. If there are too many, there will be problems.
<High-priority process
N low-priority processes
L memory paging locked in the memory
S main process
L multi-threaded Process
+ Frontend Processes
Show all processes in the pstree tree
Netstat view network conditions
Netstat-lnp
Netstat-an: view all connections of the current system