Some commands are essential for online troubleshooting. It is necessary to summarize some common commands (such commands and related parameters are quite a lot and only commonly used ones are summarized ), query problems can generally be divided into system parameters, performance parameters, processes, memory, network, storage, memory, and JVM:
System Parameters
CAT/proc/cpuinfo CPU Parameters
CAT/proc/meminfo memory Parameters
CAT/proc/loadavg Load
Performance Parameters
1) Top
M: sort by memory usage
P: sort by CPU usage
1: displays the usage of each CPU
K: Kill Process
O: More sorting rules
Enter: refresh data
2) ulimit
Ulimit-A: displays the user's system limit parameters
Ulimit-HN <num>: Change the maximum number of hard open files.
Ulimit-Sn <num>: Change the maximum number of soft open files.
3) vmstat
Vmstat 5-s m: refresh vmstat data in 5 seconds (unit: m)
Process
1) PS
PS aux: displays details of all user processes
PS-EF: display details of all user processes in another style
If the display is incomplete, it can be widened through-W, such as PS aux-www.
Network
1) netstat
Netstat-NA: displays all network connections
Netstat-nap: displays all network connections with process information
Netstat-NAT: displays all TCP network connections.
Netstat-ln: displays all network connections in the listener status
Storage
1) DF-H: general situation of Hard Disk Storage
2) du -- Max-depth = 1-H <path>: specify the size of all folders in the path (recursive layer)
3) du-SH <path>: Specify the directory size.
Memory
Free-m
It is worth noting that: idle memory = free + buffers + cached = total-used
JVM
1) jstat
Jstat-gccapacity <jpid>: The remaining status of each JVM region.
Jstat-gcutil <jpid>: JVM usage in each region
Jstat-gccause <jpid>: Causes of GC added to the jstat-gcutil Foundation
In addition, you can specify the update frequency, such as-H5 1 s: update every second, and add the header to display every five
2) JPs
Currently running Java Process
3) jmap
Jmap-dump: format = B, file = jmap. Log <jpid>: Generate heap dump file
Jmap-heap <jpid>: displays the overall situation of JVM heap.
Jmap-histo: Live <jpid>: displays memory usage of class instances.
4) jstack
Jstack-L <jpid>: displays thread congestion and deadlocks.
the commands and parameters are not described in detail. For more information, see the relevant documentation. This is so much for the time being and will be further supplemented.