Linux load average high, Java project

Linux load problems, in daily development, often suffer from us; below to sort out several factors that lead to changes in Linux load.

Case 1: CPU high, Load high

1. Use the top command to find the process PID that occupies the highest CPU;

2. Find the thread TID occupying the highest CPU by top -Hp pid;

3. For java programs, use jstack to print thread stack information;

4. Print out the hexadecimal of the most CPU thread by printf %x tid;

5. View the stack information of the thread in the stack information;

Case 2: CPU low, Load high

1. Use the top command to check the CPU wait IO time, that is, %wa;

2. View disk IO status via iostat -d -x -m 1 10; (sudo apt install sysstat)

3. View network IO status through sar -n DEV 1 10;

ylspirit@ubuntu:~$ sar 3 2   

#Exit every 3s, output 2 times

4. Find the program that occupies IO by the linux ps command;

ylspirit@ubuntu:~$ ps -e -L -o stat,cmd,pid | awk -F" " '{if($1=="R+"||$1=="R"||$1=="D"){print $0};if(NR==1) {print $0}}'

Related commands:

View linux load average: three ways to view linux load average and load explained

More about Linux commands: Linux Commands Tutorial

Add a Comment

Your email address will not be published. Required fields are marked *