The server in the production environment slows down, diagnosis ideas and performance evaluation

1. Whole machine: top, uptime, simplified version of system performance commands
2. CPU: vmstat
view cpu
Insert picture description here
Insert picture description here
view all CPU core information
mpstat -P ALL 2
usage breakdown information of cpu used by each process
pidstat -u 1 -p process number

3. Memory: free
pidstat -p process number -r sampling interval in seconds

4. Hard disk: df

5. Disk IO: iostat
disk I/O performance evaluation.
Insert picture description here
Insert picture description here
View extra: pidstat -d sampling interval in seconds -p process number

6. Network IO: ifstat
Insert picture description here
Insert picture description here

CPU usage is too high, please talk about your analysis ideas and positioning

  1. First use the top command to find the CPU with the highest proportion
  2. ps -ef or jps further locates and knows what kind of background program it is
  3. Locate a specific thread or code
    ps -mp process -o THREAD, tid, time
    -m display all threads
    -p pid process using cpu time
    -o after this parameter is a user-defined format
  4. Convert the required thread ID to hexadecimal format (English lowercase format)
    printf “%x\n” The thread ID in question
  5. jstack process ID | grep tid (hexadecimal thread ID lowercase English) -A60

JDK comes with JVM monitoring and performance analysis tool
jps (virtual machine process status tool)
jinfo (Java configuration information tool)
jmap (memory imaging tool)
jstat (statistical information monitoring tool)

Guess you like

Origin blog.csdn.net/m0_46449152/article/details/111936485