[Operating system] Directly optimize and improve CPU performance in Linux system (solved)

Problem: The server CPU does not use the highest performance, resulting in slow processing speed when running the algorithm

The server that crashed by me ran SLAM after restarting and found that the processing of pictures became stuck. I checked the top and saw that the CPU occupancy rate reached 100% in a few seconds and then withered directly. The occupancy rate has never recovered since then. Gas, it turns out that the CPU performance is limited, so you need to reset a wave
insert image description here

1. BIOS method

Mine is a GIGABYTE mainboard (GIGABYTE). After rebooting, press the [DELETE] key to enter the BIOS interface, but because I am connected remotely, it is not easy to go to the BIOS, so the second method is used.
In the future, I will write a BIOS optimization CPU method. There are many other tutorials on the Internet. It is much easier to have a graphical interface. Let me put an overclocking method here first.

(1) Enter the overclocking setting option; select frequency / voltage control or Power BIOS Features or OverClocking setting (s) or Genie BIOS Setting or Advanced (configure system Frequency/ Voltage); (2) After entering, find CPU Frequency and CPU Voltage (not
available (3) Adjust
the value of CPU Frequency (FSB), add 10 each time (this value is generally between 200-300), press F10 and then press Y (save, exit and restart); (
4 ) The computer restarts and enters the system, reads the CPU temperature with temperature measuring software, and continues below 60 degrees.
(5) Return to step 1 and repeat the above steps;
(6) Return to step 1 in case of failure to boot or other errors, enter CPU Voltage (voltage), add 0.05 to the value, save and exit, if the error still occurs, reduce the CPU Frequency by 10.
(7) Do advanced overclocking after getting familiar with the BIOS. Note: Overclocking will reduce the life of the CPU; overclocking (especially with voltage) may cause the CPU to burn.

2. The terminal directly sets the CPU regulator method

1. View the current CPU regulator

At first glance, it is the powersave power saving mode, no wonder the algorithm will be stuck, so change it quickly
cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor
insert image description here

2. Install various dependent libraries

sudo apt install linux-tools-common
sudo apt install linux-tools-generic linux-cloud-tools-generic

The following one needs to cat /porc/versionmodify the version number according to the linux version you came out of

sudo apt install linux-tools-5.4.0-109-generic linux-cloud-tools-5.4.0-109-generic

3. Finally, install the cpufrequtis toolkit and set the CPU regulator

sudo apt install cpufrequtils
sudo cpupower frequency-set -g performance
insert image description here
insert image description here
Done, running the algorithm CPU takes off again

https://www.jianshu.com/p/e1a37771c68e

3. Automatically set CPU mode when booting

The above method can only be set once, and it will return to the default mode after restarting the system. The following is the method to modify the default mode:

1. Install the sysfsutils toolkit
sudo apt-get install sysfsutils

2. Edit vim /etc/sysfs.conffile and add statements:
devices/system/cpu/cpu0/cpufreq/scaling_governor = performance
...
devices/system/cpu/cpu4/cpufreq/scaling_governor = performance
Set a few statements according to the number of CPU cores

https://blog.csdn.net/li528405176/article/details/82823922

4. There is another way to use cpufrequtis

1. Also refer to 2 to install the cpufreqtis toolkit, and then proceed to the following steps:
sudo vim /etc/init.d/cpufrequtils
modify the cpufrequtils configuration file: GOVERNOR="ondemand"to GOVERNOR="performance"
2, and execute the command /etc/init.d/cpufrequtils restartto restart the relevant cpufreq management software

https://blog.csdn.net/absinjun/article/details/80837909
https://www.cnblogs.com/276815076/p/5434295.html

Guess you like

Origin blog.csdn.net/BigHandsome2020/article/details/124472015