learn top command

Top is a performance analysis tool under Linux, which is used to display the resource usage of each process in the system in real time, similar to the Windows resource manager.

1. The first 5 lines are the overall statistical information area:
the first line, task queue information
top - 14:13:29 up 14 days, 23:41, 3 users, load average: 0.00, 0.03, 0.05
1) 14:13 :29 --> the current time of the system
2) up 14 days, 23:41 --> the system has been running for 14 days, 23 hours and 41 minutes (no restart during this period)
3) 3 users --> there are currently 3 users Login
4) load average: 0.00, 0.03, 0.05 --> 1 minute, 5 minutes, 15 minutes of load respectively
Note : CUP load average data is every 5 seconds, check the number of active processes, and then press the specific value calculated by the algorithm. If this number is divided by the amount of data on the CPU, if it is greater than 5, it means that the system is overloaded.

The second line, Tasks - tasks (processes)
Tasks: 108 total, 2 running, 106 sleeping, 0 stopped, 0 zombie
The system has a total of 108 processes, of which 2 are running, 106 are sleeping, 0 In the third line of stop, 0 zombies (zombies)

, cpu status information
%Cpu(s): 0.6 us, 0.8 sy, 0.0 ni, 98.5 id, 0.0 wa, 0.1 hi, 0.0 si, 0.0 st

0.6 us --> User occupies 0.6% CPU
0.8 sy --> Kernel space occupies 0.8% CPU
0.0 ni --> Process that has changed the priority occupies CPU percentage
98.5 id --> Idle CPU percentage
0.0 wa --> IO The percentage of CPU occupied by
0.1 hi --> the percentage of hardware IRQ occupied by CPU
0.0 si --> the percentage of CPU occupied by software interrupts (Software Interrupts) The

fourth line, the memory status
KiB Mem: 8176880 total, 4127568 used, 4049312 free , 180040 buffers
8176880 total -- total physical memory (8G)
4127568 used -- memory in use (4G)
4049312 free -- free memory (4G)
180040 buffers -- cache occupied memory (180M)

fifth line, swap Swap partition information
KiB Swap: 8388604 total, 0 used, 8388604 free. 3434140 cached Mem
8388604 total -- total swap area
0 used -- swap area in use
8388604 free -- free swap area
3434140 cached -- buffered swap Area

Note: 1. When the physical memory of the system is not enough, the Swap partition will release a part of the hard disk space for the current running program to use.
2. Available memory calculation method: free in the fourth line + buffers in the fourth line + cached in the fifth line
3. We need to monitor the used of the swap partition in the fifth line at all times. If this value is constantly changing, it means that the kernel is constantly changing. For data exchange between memory and swap, this is the real memory is not enough.

The sixth line, blank line The

seventh line, the status monitoring of each process (task):
PID: process id
USER: process owner
PR: process priority
NI: nice value. Negative value means high priority, positive value means low priority
VIRT: Total virtual memory used by the process, in kb
RES: Size of physical memory used by the process but not swapped out, in kb
SHR: Shared memory size, in unit kb
S: process state: D=uninterruptible sleep state; R=running S=sleep T=trace/stop Z=
zombie
process Memory percentage
TIME+: Total CUP time used by the process, unit 1/100 second
COMMAND: Process name

Note : 1. For multi-core CPU, press the number "1" on the keyboard to monitor the status of each logical CPU

======= ===========================

jstack is used to print out the given java process id or core file or the java stack information of the remote debugging service

jstat is used to monitor the JVM and monitor the usage of the "heap" in real time. jstat can monitor the following:
-- Loading and unloading of classes
-- Viewing the capacity and usage of the
new generation, old generation, and persistent generation -- Viewing the garbage collection status of the new generation, old generation, and persistent generation, including garbage collection The number of times and the time taken for garbage collection.
-- Check the capacity and allocation of the Eden area and Survior area in the new generation


Guess you like

Origin http://10.200.1.11:23101/article/api/json?id=326990480&siteId=291194637