Use w to view system load, vmstat command, top command, sar command, nload command

Use w to view system load

w or uptime to view system load
w uptime

Use w to view system load, vmstat command, top command, sar command, nload command

The first line is the current time, how long it takes to start, how many users are currently logged in, and the system load (there are three numbers after the load average, which indicate the load value of the system in 1, 5, and 15 minutes, respectively).
Use w to view system load, vmstat command, top command, sar command, nload command

The logged-in user can see from the third row. From the first column, the user name, which terminal is logged in (pts/0 means remote login tty/1 means local login), IP address, login time, idle time time and so on.
Use w to view system load, vmstat command, top command, sar command, nload command

The meaning of the three numbers after the load average: how many active processes are using the cpu in a unit time period (if the number of physical cpus is 1, then the load is 1 is the best, there is no load and no vacancy, that is to say no more than The number of logical cpus is the best)
Use w to view system load, vmstat command, top command, sar command, nload command

cat /proc/cpuinfo to view the number of CPUs. If the processor is followed by 0, it means one CPU, 1 means 2, and 40 or 39 means 40. (The number of CPUs here is not the actual number of CPUs, but the number of logical CPUs. )
cat /proc/cpuinfo

Use w to view system load, vmstat command, top command, sar command, nload command

vmstat command

The vmstat command is used to view the conditions including cpu, memory, virtual disk, swap partition, disk, system process, etc.
Generally, use vmstat 1, which can display the situation of each item every second, stop pressing ctrl+c, or use vmstat 1 5 to display 5 the following items.
vmstat 1 5

Use w to view system load, vmstat command, top command, sar command, nload command

Among them, the parameters we need to pay attention to are, r, b, swpd, si, so, bi, bo, us, wa

The meaning of these parameters:
r (run): how many processes are in the queue

b (block): Several processes are in a waiting state (the network speed or hard disk may cause the process to be slow)

swpd: If this number changes frequently, it means that the memory is insufficient.

si, so: how many kb of data si has entered into memory from swpd, and so came out of memory. (Related to swpd, if a column of swpd is changing frequently, then these two columns will also change)

bi, bo: bi comes out of the disk into the memory (the amount of data read), and bo writes from the memory to the disk (the amount of data written). If the amount of these two data is large, it means that the disk is reading and writing frequently.

us: The CPU usage of user-level processes. The percentage display, the maximum will not exceed 100, if it is greater than 50 for a long time, it means that the resources are not enough.

sy: The percentage of CPU occupied by system processes.

id: is the percentage of cup idle.

wa: The percentage of waiting cpu (similar to b, if this item is relatively large, it means that the cpu is not enough

top command

Top command to view the resource usage of specific processes (displayed every three seconds, q to exit) and
toppress Enter

Use w to view system load, vmstat command, top command, sar command, nload command

The first line is the same as the w command

The second line is how many tasks, processes (total), how many running tasks (running), how many tasks are sleeping, (stop) stopped tasks, (zombies, refers to The unattended child process left by the main process unexpectedly terminated) zombie's task.

The third line is the percentage of CPU usage. Unlike the system load, the system load is the process that occupies the CPU per unit time. The occupied process is not necessarily running, but may be in a sleep state. (The system load may be high, but at this time, the CPU usage may be very low. If the CPU usage is high, the system load is generally high)

The fourth and fifth lines are the memory usage, the fourth line is the physical memory, and the fifth line is the swap partition. Generally, we focus on the fourth line, and the following values ​​are the total memory, remaining memory, used memory, etc.

Then the line below is what we want to focus on, sorted by cpu usage by default (%CPU). RES refers to the occupied memory (unit is kb), which is used when the PID kills the process. If you want it to be sorted by memory usage, type a capital m, and if you want to change it back, press a capital p.

按数字1列出所有cpu使用情况(上面第三行的CPU后边会切换单CPU)。没有按1前显示的是所有cpu的平均值。

top -c can view the specific command
top -c

Use w to view system load, vmstat command, top command, sar command, nload command

top -bn1 static display (suitable for writing scripts)
Use w to view system load, vmstat command, top command, sar command, nload command
Use w to view system load, vmstat command, top command, sar command, nload command

sar command

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325274584&siteId=291194637