Detailed explanation of linux top and free

The first line of the top command

//The first line is the task queue information

21:50:47 represents the current system time

up 6:26 represents how long the current system has been running, in the format of hours: minutes

2 users represents the number of users logged in to the current system.

load average: 0.00, 0.00, 0.00 This represents the system load, that is, the average length of the task queue. The three values ​​are all 1 minute. The smaller the three values, the better. The smaller the values, the lower the system load. When it is higher than 5, the system load is serious.

The second line of the top command

//The second line represents the system process information

208 total represents the total number of processes in the current system

1 running indicates the number of processes currently running on the system

207 sleeping represents the number of current system sleep processes

0 stopped indicates the number of processes stopped in the current system.

0 zombie represents the number of zombie processes in the current system.

The third line of the top command

//The third line represents the system CPU information

0.0 us represents the percentage of CPU occupied by user space

0.2 sy represents the percentage of CPU occupied by kernel space.

0.0 ni represents the CPU percentage occupied by processes that have changed priorities in the user process space.

99.8 id represents idle CPU percentage

0.0 wa represents the percentage of CPU time waiting for input and output

0.0 hi indicates the percentage of CPU occupied by hard interrupts

0.0 si represents the percentage of CPU occupied by soft interrupts

0.0 st is used in the case of virtual CPU, indicating the CPU time stolen by the virtual machine.

The fourth line of the top command

//The fourth line is the system memory information

1800.6 total represents the total amount of physical memory

1010.9 free represents the total amount of free memory

382.3 used represents the total amount of physical memory used

407.5 buff/cache represents the amount of memory used as kernel cache

The fifth line of the top command

//The fifth line displays the system's swap partition information.

2092.0 total represents the total amount of swap partitions

2092.0 free represents the total amount of free swap area

0.0 used represents the total amount of swap partitions used

1255.4 avail Mem represents the amount of physical memory that can be used for the next allocation of the process

The sixth line of the top command

PID represents the id of the process

USER process is owned by which user

PR stands for priority

NI nice value is all our priorities. Negative values ​​have higher priority, and positive values ​​have lower priority than negative values.

VIRT The total amount of virtual memory used by the process, in kb, VIRT=SWAP (swap partition) + RES

RES represents the size of physical memory used by the process that has not been swapped out, in kb. RES=CODE+DATA

CODE represents the physical memory occupied by executable code, in kb.

SHR represents the size of shared memory, the unit is also kb

S represents process status. D=uninterruptible sleep state; R=run'; S=sleep; T=track/stop; Z=zombie process

%CPU represents the percentage of CPU time occupied since the last update.

%MEM represents the percentage of physical memory used by the process

TIME+ represents the total CPU time used by the process, unit 1/100 second

COMMAND represents the command name/command line

WCHAN means that if the process is sleeping, the name of the sleeping system function is displayed.

nFLT page fault count

nDRT The number of pages that have been modified since the last time it was written.

free command

// The free command is used to view system memory, but the static method is different from the top command. The free command is also a command that is asked more frequently in operation and maintenance interviews.

[root@server ~]# free

total used free shared buff/cache available

Mem: 1843864 390628 1035936 8888 417300 1286336

Swap: 2142204 0 2142204

1

2

3

4

total represents the total number of memory, the total number of physical memory

used The amount of memory that has been used

free represents the amount of free memory

shared The total amount of memory shared by multiple processes

buff/cache cache memory number

//The relationship between the total memory and the number of used memory and free memory

total=used+free

There is another important point that I have not mentioned here but I will list it for you.

-/+ buffers/cache

-buffers/cache: is the actual amount of memory used

+buffers/cache: The amount of available memory.

-buffers/cache is actually the memory actually used by the process or service; +buffers/cache is the total amount of memory that can be used.

————————————————

Original link: https://blog.csdn.net/qq_60387497/article/details/122952490

Guess you like

Origin blog.csdn.net/xia_2017/article/details/128921778