top daily (detailed explanation of parameters)

Tob ( statistical information area and process information area )

Statistics Information Area

Insert picture description here

The first line: task queue information

  • 19:20:58: System time
  • up 34 days: the running time of the host
  • 1 users: the number of user connections (not the number of users, who command)
  • Load average: 0.00, 0.01, 0.05: system average load, statistics the system average load of the last 1, 5, and 15 minutes

Second line: process information

  • xx total: total number of processes
  • x running: the number of running processes
  • x sleeping: the number of sleeping processes
  • xstopped: the number of stopped processes
  • x zombie: the number of zombie processes

The third line: CPU information (when there are multiple CPUs, these contents will exceed two lines)

  • xx.x us: CPU percentage occupied by user space
  • x.xsy: CPU percentage occupied by kernel space
  • x ni: The percentage of CPU occupied by processes whose priority has been changed in the user process space
  • xx id: percentage of idle CPU
  • xx wa: CPU time percentage waiting for input and output
  • xx hi: hardware CPU terminal occupancy percentage
  • xx si: percentage of soft interrupt occupation
  • xx st: Percentage occupied by virtual machines

The fourth line: memory information (similar to the information in the fifth line and similar to the free command)

  • xx total: total physical memory
  • xx free: the total amount of memory used
  • xx used: the total amount of free memory (free + userd = total)
  • xx buff/cache: the amount of memory used as kernel cache

The fifth line: swap information

  • xx total: total exchange partition
  • xx free: the total amount of used swap partition
  • xx used: Total number of free swap partitions
  • xx avail: The total amount of buffered swap area. The contents of the memory are swapped out to the swap area and then swapped back into the memory, but the used swap area is not covered. The contents of the swap area already exist in the memory. The size of the swap area, when the corresponding memory is swapped out again, there is no need to write to the swap area.

Process information area

Insert picture description here

  • PID: process id
  • PPID: parent process id
  • RUSER: Real user name (I have read a lot of them, they are all written like this, and I don’t know the difference with user, please add here)
  • UID: id of the process owner
  • USER: the user name of the process owner
  • GROUP: The group name of the process owner
  • TTY: The name of the terminal that started the process. Processes that are not started from the terminal are displayed as?
  • PR: Priority
  • NI: nice value. Negative value indicates high priority, positive value indicates low priority
  • P: The last used CPU, only meaningful in a multi-CPU environment
  • %CPU: The percentage of CPU time occupied from the last update to the present
  • TIME: The total CPU time used by the process, in seconds
  • TIME+: The total CPU time used by the process, in units of 1/100 second
  • %MEM: The percentage of physical memory used by the process
  • VIRT: The total amount of virtual memory used by the process, in kb. VIRT=SWAP+RES
  • SWAP: The size of the virtual memory used by the process to be swapped out
  • RES: The size of the physical memory used by the process that has not been swapped out
  • CODE: The size of physical memory occupied by executable code
  • DATA: The size of physical memory occupied by parts other than executable code (data segment + stack)
  • SHR: Shared memory size
  • nFLT: Number of page faults
  • nDRT: The number of pages that have been modified since the last write
  • S: Process state (D=uninterruptible sleep state, R=run, S=sleep, T=track/stop, Z=zombie process)
  • COMMAND: command name/line
  • WCHAN: If the process is sleeping, display the name of the system function in sleep
  • Flags: mission flags

Use of top command

top use format

top [-] [d] [p] [q] [c] [C] [S] [s] [n]

top parameter description

  • d: Specify the time interval between every two screen information refreshes. Of course the user can use the s interactive command to change it.
  • p: Only monitor the status of a certain process by specifying the monitoring process ID.
  • q: This option will make top refresh without any delay. If the calling program has super user privileges, then top will run with the highest possible priority.
  • S: Specify accumulation mode
  • s: Make the top command run in safe mode. This will remove the potential dangers caused by interactive commands.
  • i: Make top not display any idle or dead processes.
  • c: display the entire command line instead of just the command name

Interactive command

  • Ctrl+L: Erase and rewrite the screen.
  • h or?: Display the help screen and give a brief summary of commands.
  • k: Terminate a process. The system will prompt the user to enter the PID of the process that needs to be terminated and what kind of signal needs to be sent to the process. The general termination process can use 15 signal; if it can't be terminated normally, use signal 9 to force the end of the process. The default value is signal 15. This command is blocked in safe mode.
  • i: Ignore idle and dead processes. This is a switch command.
  • q: Exit the program.
  • r: rearrange the priority of a process. The system prompts the user to enter the PID of the process to be changed and the priority value of the process to be set. Entering a positive value will lower the priority, and vice versa, the process can have a higher priority. The default value is 10.
  • S: Switch to accumulation mode.
  • s: Change the delay time between two refreshes. The system will prompt the user to enter the new time in s. If there is a decimal, it is converted to ms. Enter a value of 0 and the system will continue to refresh. The default value is 5 s. It should be noted that if the time is set too small, it is likely to cause constant refresh, so that there is no time to see the display clearly, and the system load will increase greatly.
    f or F: Add or delete items from the current display.
    o or O: Change the order of displayed items.
  • l: Switch to display average load and start time information.
  • m: Switch to display memory information.
  • t: Switch to display process and CPU status information.
  • c: Switch to display the command name and the complete command line.
  • M: Sort according to the size of the resident memory.
  • P: Sort according to the percentage of CPU usage.
  • T: Sort by time/cumulative time.
  • W: Write the current settings into the ~/.toprc file. This is the recommended way to write top configuration files.

Guess you like

Origin blog.csdn.net/a1749437237/article/details/108607131